RC.1/IVY - export 'EffectsFeatureModule' (imported as 'i2') was not found in @ngrx/effects
See original GitHub issue🐞 bug report
Affected Package
After upgrading to RC1 and turning on IVY I get tons of errors from the @ngrx/effects module.
"export 'EffectsFeatureModule' (imported as 'i2') was not found in '@ngrx/effects'
"export 'EffectsFeatureModule' (imported as 'i2') was not found in '@ngrx/effects'
… and so on…
Turning off IVY everything works without an issue.
This is from a production app running NG8 currently in production. It uses @ngrx/store and effects module.
I’ve never had these issues with the .next-x and rc.0 versions.
Is this a regression?
I think so
Yes, the previous version in which this bug was not present was: ....I believe so. I’ve never seen this issue before and I’ve tested all .next versions and rc.0
Description
ng serve yields lots off errors like:
ERROR in ./src/app/store/bizz-store/bizz-store.module.ts 19:79-102
"export 'EffectsFeatureModule' (imported as 'i1') was not found in '@ngrx/effects'
ERROR in ./src/app/modules/lazy-shared/lazy-shared.module.ts 136:26-50
"export 'EffectsFeatureModule' (imported as 'i16') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/dashboard/dashboard.module.ts 58:520-544
"export 'EffectsFeatureModule' (imported as 'i16') was not found in '@ngrx/effects'
ERROR in ./src/app/store/iticket-store/iticket-store.module.ts 22:105-128
"export 'EffectsFeatureModule' (imported as 'i2') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/login/store/login-store.module.ts 24:103-126
"export 'EffectsFeatureModule' (imported as 'i2') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/gdpr/gdpr.module.ts 40:149-172
"export 'EffectsFeatureModule' (imported as 'i3') was not found in '@ngrx/effects'
ERROR in ./src/app/modules/licenseplate-checker/licenseplate-checker-module.ts 25:162-185
"export 'EffectsFeatureModule' (imported as 'i3') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/feedback/feedback.module.ts 38:185-208
"export 'EffectsFeatureModule' (imported as 'i3') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/weather/weather.module.ts 38:182-205
"export 'EffectsFeatureModule' (imported as 'i3') was not found in '@ngrx/effects'
ERROR in ./src/app/feature-modules/receipt/receipt.module.ts 39:170-193
"export 'EffectsFeatureModule' (imported as 'i4') was not found in '@ngrx/effects'
🔬 Minimal Reproduction
Unfortunately I cannot share my repo but if nobody has seen this issue before I’ll try and do a minimal version.
https://stackblitz.com/...🔥 Exception or Error
🌍 Your Environment
Angular Version:
Angular CLI: 9.0.0-rc.1
Node: 12.2.0
OS: darwin x64
Angular: 9.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.1
@angular-devkit/build-angular 0.900.0-rc.1
@angular-devkit/build-optimizer 0.900.0-rc.1
@angular-devkit/build-webpack 0.900.0-rc.1
@angular-devkit/core 9.0.0-rc.1
@angular-devkit/schematics 9.0.0-rc.1
@angular/cdk 9.0.0-rc.0
@angular/material 9.0.0-rc.0
@angular/material-moment-adapter 9.0.0-rc.0
@ngtools/webpack 9.0.0-rc.1
@schematics/angular 9.0.0-rc.1
@schematics/update 0.900.0-rc.1
rxjs 7.0.0-alpha.0
typescript 3.6.4
webpack 4.41.2
Anything else relevant?
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
node_module error in ngrx store and effects - Stack Overflow
ts:1:10 - error ts2305: module '"@angular/core"' has no exported member 'importedngmoduleproviders'. My version of angular is 13, so I ...
Read more >export 'link' (imported as 'link') was not found in 'react-router'
After upgrading to RC1 and turning on IVY I get tons of errors from the @ngrx/effects module. "export 'EffectsFeatureModule' (imported as 'i2') was...
Read more >NG0301: Export not found! - Angular
For example, if the export not found is ngForm , we need to import FormsModule and declare it in the list of imports...
Read more >Understanding the magic behind @ngrx/effects - InDepth.Dev
This article dives deep into internals of ngrx/effects class. ... @NgModule({}) export class EffectsFeatureModule { constructor( // Make ...
Read more >@ngrx/effects | Yarn - Package Manager
15.0.0-rc.0 (2022-11-23). Features. component: clear LetDirective view when replaced observable is in suspense state (#3671 (ec59c4b) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@petebacondarwin @dannyskoog I was able to reproduce the issue when using NgRx within a library, and the target is
es5
.Here is the repo: https://github.com/brandonroberts/ngrx-ivy-lib-build-error.
yarn
to install dependenciesng build my-lib
to build the libraryng build
to build the app@brandonroberts @dannyskoog Thanks for providing this information. Together with https://github.com/angular/angular/issues/33100#issuecomment-546610580 this helped me track down the issue.
This is an appearance of a bug that #32902 was supposed to have fixed. I don’t know exactly how this can still be broken as I recall that fix to have made a difference back then, but apparently some other circumstances were at play there.
There was a migration to install a postinstall hook to run ngcc, with a set of properties that are suitable for ES2015 targets. When targeting ES5 however, as @dannyskoog rightfully found out, the compilation under the CLI is loading ES5 bundles as the previously processed ES2015 bundles cannot be used. During this additional processing of the ES5 bundle it was not necessary to process the .d.ts files, as these had already been processed during the postinstall hook when processing ES2015. This prevents the migration for
ModuleWithProviders
to run, as it’s primarily there to update .d.ts files. However, it is also responsible for detecting the case where the imported NgModule needs to become a public export for the Ivy compiler to refer to.Please see the description in #32902 for more info. I expect to open a PR with a fix soon.