Error: Can't resolve 'swiper_angular' swiper in angular 11

Viewed 2249

I have the following error for using swiper in the project.

Error: ./node_modules/swiper/angular/swiper_angular.ngfactory.js
Module not found: Error: Can't resolve 'swiper_angular' in 'D:\Source\PharmacySite\pharmacySite4\PharmacySite\fronend\node_modules\swiper\angular'

in app.module.ts inported import { SwiperModule } from 'swiper/angular';

2 Answers

In tsconfig.json file, add the entry for swiper_angular as shown in the following and restart your server:

"compilerOptions": {
  "paths": {
    "swiper_angular": ["node_modules/swiper/angular"]
  }
}
Related