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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression? Some effects not working as before in prod mode. #1905

Closed
liesahead opened this issue Jun 3, 2019 · 9 comments
Closed

Regression? Some effects not working as before in prod mode. #1905

liesahead opened this issue Jun 3, 2019 · 9 comments
Labels
Blocked (External) Blocked by external package bug

Comments

@liesahead
Copy link

liesahead commented Jun 3, 2019

Minimal reproduction of the bug/regression with instructions:

I have a custom library, which contains some global modules, for example AuthModule. Until I have updated my projects to angular 8, everything worked fine. After I did that, most effects in my custom library don't work. Actions are dispatched, reducers are called, but effects.. Not really. However, one effect is called and it returns another action, which is not dispatched for some reason.

This happens only in production build AND with buildOptimizer set to true. if buildOptimizer is disabled, then everything works as expected. Also, I have created an issue here, because I don't know if it's ngrx bug or angular-cli:

angular/angular-cli#14613

Expected behavior:

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

Angular CLI: 8.0.1
Node: 10.7.0
OS: win32 x64
Angular: 8.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package Version

@ngrx/core: ^1.2.0
@ngrx/effects: ^7.4.0
@ngrx/entity: ^7.4.0
@ngrx/router-store: ^7.4.0
@ngrx/store: ^7.4.0

@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.1
@angular-devkit/build-ng-packagr 0.800.1
@angular-devkit/build-optimizer 0.800.1
@angular-devkit/build-webpack 0.800.1
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cli 8.0.1
@angular/flex-layout 8.0.0-beta.26
@ngtools/json-schema 1.1.0
@ngtools/webpack 8.0.1
@schematics/angular 8.0.1
@schematics/update 0.800.1
ng-packagr 5.2.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0

I would be willing to submit a PR to fix this issue

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ X ] No

@adrogon
Copy link

adrogon commented Jun 3, 2019

Hello @DenisSemionov, have you looked at #1888, is it the same behavior?

@liesahead
Copy link
Author

Hello @DenisSemionov, have you looked at #1888, is it the same behavior?

Hello, @adrogon, looks very similar, but that author didn't mention buildOptimizer setting, so can't say for sure.

@timdeschryver
Copy link
Member

Could you create a small reproduction of this issue?
I couldn't be able to reproduce this issue.

@liesahead
Copy link
Author

liesahead commented Jun 3, 2019

@timdeschryver , I will try to create a repro during this week. I'm not sure yet what causes the problems, ngrx works well as previously, but after I updated my projects to angular 8 effects in my custom library are behaving strangely, they are not triggered.

@liesahead
Copy link
Author

liesahead commented Jun 3, 2019

@timdeschryver , @brandonroberts , I have been able to reproduce it.

Clone this repro project, then build the library ng build disastrous-library, then ng serve angular-ngrx. Try to press the buttons with labels "DO THIS" and "DO THAT" (you will see text with explanation) and see the browser log. Then build ng build angular-ngrx --prod and deploy it. You will see that effects in library stopped working, they are not triggered anymore.

Also, you will notice that user list is loading without any problems, because effects for users are not in library but in main project.

https://github.com/DenisSemionov/ngrx-bug-repro

@alex-okrushko
Copy link
Member

I think this is related to ng-packagr/ng-packagr#1307

@alan-agius4
Copy link
Contributor

Hi all, this issue is caused by the Angular Devkit Build Optimizer.

See here for more context: angular/angular-cli#14613 (comment)

I have already landed a fix for this.

@brandonroberts brandonroberts pinned this issue Jun 5, 2019
@brandonroberts brandonroberts reopened this Jun 5, 2019
@brandonroberts brandonroberts added Blocked (External) Blocked by external package and removed Needs Reproduction labels Jun 5, 2019
alexeagle pushed a commit to angular/angular-cli that referenced this issue Jun 6, 2019
alexeagle pushed a commit to angular/angular-cli that referenced this issue Jun 6, 2019
@brandonroberts
Copy link
Member

This fix has been verified with Angular CLI 8.0.2 and NgRx 8.0.0.

@brandonroberts brandonroberts unpinned this issue Jun 6, 2019
@Rambou
Copy link

Rambou commented Jan 21, 2021

We have experienced the same regression for NgRx 7.4.0 we are using Angular CLI 7.3.9 are there any news what exactly was the regression from Angular DevKit side and if there's any fix for that version of NgRx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked (External) Blocked by external package bug
Projects
None yet
Development

No branches or pull requests

7 participants