Swiper/angular cannot be found

Hello, I’m starting to lose track here. I have had to leave my app for a few weeks for another project. But in the meantime I reinstalled Windows and switched to Windows 11. So I had to set up my development environment completely new. I think everything is up to date now.

npm list

├── rxjs@7.8.0
├── swiper@9.0.4
├── ts-node@10.9.1

npm -g list
├── @angular/cli@15.1.5
└── @ionic/cli@6.20.8

ng version
Angular CLI: 15.1.5
Node: 18.14.0
Package Manager: npm 9.3.1
OS: win32 x64

But when I open the app now I get error messages. It can’t find the swiper module anymore, even though Sweeper is installed.

Error: src/app/pages/intro/intro.page.html:30:3 - error NG8001: 'swiper' is not a known element:
1. If 'swiper' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

30   <swiper pager="true" #slideWithNav="">

Here in the import line I get the message, that swiper /angular cannot be found.

import { SwiperModule } from 'swiper/angular';

I ve followed the documentation (angular/slides). The swiper had worked a few weeks ago. On the Webpage swiperjs.com I can read that its not awailable for angular? Does it have to be done differently again? It would be nice if someone could help me here and clear up my frustration.

You need to import the SwiperModule in the module you are using it in.

I added the import line in the approprate intro.module.ts file, but I get the message, that the module cannot be found (error code ts2307). Here is the tree of Swiper v9

create a stackblitz project replicating the issue and post the project link here.

The example in the angular/slides documentation is using @ionic/angular v6 + Swiper v8, so you need to install Swiper v8, not the latest version.

1 Like

Thanks, with version 8 the problem could be resolved. This means I have to be carefull with keeping the system up to date. I still have a simular problem with the videogular/ngx-videogular package and installing an older version doesnt work, seems it always works only with a certain angular version.