Problem with swiper version 8 and angular version 16

40 Views Asked by At

I have upgraded my Angular application to version 16 and I am also using swiper version 8, but when I run the build:ssr command, I get errors like this (this problem did not exist in the previous version of my application):

./src/app/modules/pages/enterprise-price-list/enterprise-price-list.module.ts:9:18-43 - Error: Module not found: Error: Can't resolve 'swiper_angular' in 'C :\
Users\asghari\WebProject\Angular\cloud_market_ssr\client\src\app\modules\pages\enterprise-price-list'

I removed node_modules and package-lock.json and ran npm i again but still this error didn't go away, I also tried swiper version 6 - 7 and 9 please help me

To solve this problem, I first deleted node_modules and package-lock-json, and after running the npm cache clean command, I ran the npm i command, but the problem was not solved, then different versions of swiper, including versions 6-7 and 9 I tried, but still the above problem was not solved.

1

There are 1 best solutions below

0
ali asghari On

I solved this problem by adding the item "swiper_angular": ["node_modules/swiper/angular"] inside "compilerOptions" in the tsconfig.json file.