'ERROR: has no exported member 'ɵɵFactoryDeclaration'

I am using Angular 11 and have encountered the following error when I added the swiper carousel to the project. I tried deleting and reinstalling node_modules but this did not solve the problem.

I have also tried changing the enableIvy setting in tsconfig.lib.strong textprod.json to this:

"enableIvy": false,

But that doesn't seem to have any effect.

It keeps showing the following error:

Error: node_modules/swiper/angular/angular/src/swiper-slide.directive.d.ts:24:21 - error TS2694: Namespace '"C:/Angualr project/project1/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'. 24 static ɵfac: i0.ɵɵFactoryDeclaration<SwiperSlideDirective, never>; ~~~~~~~~~~~~~~~~~~~~ node_modules/swiper/angular/angular/src/swiper-slide.directive.d.ts:25:21 - error TS2694: Namespace '"C:/Angualr project/project1/node_modules/@angular/core/core"' has no exported member 'ɵɵDirectiveDeclaration'. 25 static ɵdir: i0.ɵɵDirectiveDeclaration<SwiperSlideDirective, "ng-template[swiperSlide]", never, { "virtualIndex": "virtualIndex"; "class": "class"; "autoplayDelay": "data-swiper-autoplay"; "zoom": "zoom"; }, {}, never>; ~~~~~~~~~~~~~~~~~~~~~~ node_modules/swiper/angular/angular/src/swiper.component.d.ts:250:21 - error TS2694: Namespace '"C:/Angualr project/project1/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'. 250 static ɵfac: i0.ɵɵFactoryDeclaration<SwiperComponent, never>; ~~~~~~~~~~~~~~~~~~~~ node_modules/swiper/angular/angular/src/swiper.component.d.ts:251:21 - error TS2694: Namespace '"C:/Angualr project/project1/node_modules/@angular/core/core"' has no exported member 'ɵɵComponentDeclaration'.

Something that confused me a lot in the text of the error refers to a place that does not exist: C:/Angualr project/project1/node_modules/@angular/core/core"



Solution 1:[1]

I was having this same issue earlier, I was able to resolve this by carrying out these few steps:

  1. deleted my node_modules folder
  2. ran npm i on the command line.
  3. lastly ran ng serve.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1