Swiper js implementation - error adding register() to app.component.ts

I have this issue with the ionic v7 upgrade. The ionic tutorial say to add register() to the app.component.ts but now i get this error.

Build at: 2024-01-25T05:30:44.251Z - Hash: c85b7dae46bd0f5c - Time: 7511ms
[ng] × Failed to compile.
[ng]
[ng] ./src/app/app.component.ts:4:0-49 - Error: Module not found: Error: Package path ./swiper-element is not exported from package C:\devl\fp\priority-mobile\node_modules\swiper (see exports field in C:\devl\fp\priority-mobile\node_modules\swiper\package.json)

Please share some code, what does your import look like?

import {register} from “swiper/swiper-element”;

This is what my intellij recommended and register seems to be exported in this file.

Please try the following:

import { register } from 'swiper/element/bundle';