Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC.1/IVY - export 'EffectsFeatureModule' (imported as 'i2') was not found in @ngrx/effects #33701

Closed
spock123 opened this issue Nov 8, 2019 · 15 comments

Comments

@spock123
Copy link

@spock123 spock123 commented Nov 8, 2019

馃悶 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?

@ngbot ngbot bot added this to the needsTriage milestone Nov 8, 2019
@Dj-jom2x

This comment has been minimized.

Copy link

@Dj-jom2x Dj-jom2x commented Nov 10, 2019

not related I think.. have u tried to download @ngrx/effects
source and put it inside your src folder? like, create a folder inside src like " ngx" then put the library there. and change the public_api.ts to index.ts then import thru there. that's what I do.. when other applications are still on ag 8 and having a problem when importing at ag 9.. it works fine tho haha xD

@spock123

This comment has been minimized.

Copy link
Author

@spock123 spock123 commented Nov 10, 2019

@Dj-jom2x hi, no haven't tried that. It's kind of a hack though /s

@spock123

This comment has been minimized.

Copy link
Author

@spock123 spock123 commented Nov 11, 2019

I've also tried downgrading rxjs to latest stabile version but as expected that didn't change anything.

@petebacondarwin

This comment has been minimized.

Copy link
Member

@petebacondarwin petebacondarwin commented Nov 11, 2019

I added a PR to include ngrx in ngcc-validation: angular/ngcc-validation#559
It doesn't appear to fail but I am probably missing some detail

@dannyskoog

This comment has been minimized.

Copy link
Contributor

@dannyskoog dannyskoog commented Nov 14, 2019

I'm also experiencing this using rc.1 in combination with "@ngrx/effects": "~8.0.1"

@spock123

This comment has been minimized.

Copy link
Author

@spock123 spock123 commented Nov 14, 2019

@dannyskoog
I updated to 8.5.1 (latest stabile) but that didn't resolve the issue, unfortunately..

@petebacondarwin

This comment has been minimized.

Copy link
Member

@petebacondarwin petebacondarwin commented Nov 14, 2019

We need to prioritise getting this working. I will look into it today.

@petebacondarwin

This comment has been minimized.

Copy link
Member

@petebacondarwin petebacondarwin commented Nov 14, 2019

@spock123 and @dannyskoog - it is hard to help solve this without a reproduction. Currently I cannot make a failing ivy + ngrx app...

@petebacondarwin

This comment has been minimized.

Copy link
Member

@petebacondarwin petebacondarwin commented Nov 14, 2019

Actually @brandonroberts suggests that we open a ticket on https://github.com/ngrx/platform so it can get some visibility there too.

See ngrx/platform#2260

@petebacondarwin petebacondarwin self-assigned this Nov 14, 2019
@dannyskoog

This comment has been minimized.

Copy link
Contributor

@dannyskoog dannyskoog commented Nov 15, 2019

Sure @petebacondarwin. I鈥檒l see if I can put up a reproduction on StackBlitz tonight 馃憤

@dannyskoog

This comment has been minimized.

Copy link
Contributor

@dannyskoog dannyskoog commented Nov 15, 2019

The only lead I've found so far is that once I change the target in tsconfig.json from es5 to es2015 everything works properly. Take note @petebacondarwin

I will continue trying to create a reproduction

@brandonroberts

This comment has been minimized.

Copy link
Collaborator

@brandonroberts brandonroberts commented Nov 16, 2019

@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.

  1. clone repo
  2. run yarn to install dependencies
  3. run ng build my-lib to build the library
  4. run ng build to build the app
  5. note the build error as the same error mentioned above
@JoostK

This comment has been minimized.

Copy link
Member

@JoostK JoostK commented Nov 16, 2019

@brandonroberts @dannyskoog Thanks for providing this information. Together with #33100 (comment) 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.

@JoostK JoostK assigned JoostK and unassigned petebacondarwin Nov 16, 2019
JoostK added a commit to JoostK/angular that referenced this issue Nov 16, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that bundles that are processed after the
initial bundle had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
@dannyskoog

This comment has been minimized.

Copy link
Contributor

@dannyskoog dannyskoog commented Nov 16, 2019

Our pleasure @JoostK. And thanks for that thorough ellaboration on the root cause 馃憤

JoostK added a commit to JoostK/angular that referenced this issue Nov 16, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that bundles that are processed after the
initial bundle had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
JoostK added a commit to JoostK/angular that referenced this issue Nov 17, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that bundles that are processed after the
initial bundle had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
JoostK added a commit to JoostK/angular that referenced this issue Nov 17, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that bundles that are processed after the
initial bundle had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
JoostK added a commit to JoostK/angular that referenced this issue Nov 17, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that formats that are processed after the
initial format had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
@spock123

This comment has been minimized.

Copy link
Author

@spock123 spock123 commented Nov 18, 2019

Thank you so much guys!

gkalpak added a commit to gkalpak/angular that referenced this issue Nov 18, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that formats that are processed after the
initial format had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
JoostK added a commit to JoostK/angular that referenced this issue Nov 18, 2019
In angular#32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that formats that are processed after the
initial format had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes angular#33701
alxhub added a commit that referenced this issue Nov 18, 2019
鈥33875)

In #32902 a bug was supposedly fixed where internal classes as used
within `ModuleWithProviders` are publicly exported, even when the
typings file already contained the generic type on the
`ModuleWithProviders`. This fix turns out to have been incomplete, as
the `ModuleWithProviders` analysis is not done when not processing the
typings files.

The effect of this bug is that formats that are processed after the
initial format had been processed would not have exports for internal
symbols, resulting in "export '...' was not found in '...'" errors.

This commit fixes the bug by always running the `ModuleWithProviders`
analyzer. An integration test has been added that would fail prior to
this change.

Fixes #33701

PR Close #33875
@alxhub alxhub closed this in 7215889 Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.