-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Bug: EffectsModule, StoreRouterConnectingModule and StoreDevtoolsModule need to be imported only after StoreModule #184
Comments
@loiane , what was your symptoms for this problem, and how did you figure out it was related to import order? After I updated, i just get a |
@lucastheisen the first one I tried was StoreDevtoolsModule. It did not do anything and I did not get any errors. So I tried to change the order and it worked. Then, I tried EffectsModule. I got the no provider for Actions error, but it was because I forgot to add the Effects forRoot import. After fixing this error, it was also not working, so I decided to try again to change the import order and it worked. StoreModule.forRoot(reducers),
EffectsModule.forRoot([]),
StoreRouterConnectingModule,
!environment.production ? StoreDevtoolsModule.instrument({ maxAge: 50 }) : [] And I'm doing the same in my feature modules for the store and effects modules. |
Maybe related: I was just setting up my first Effect and ran into the error |
Oh, man I just had the same and my app.module didn't have |
I have same issue here. StoreModule.forRoot(reducers), If I remove EffectsModule, the issue gone. |
@schmkr . That worked for me. The problem was because of the deep path to referencing EffectsModule that visual studio code imported automatically for me. |
@sandangel I am having the same issue, were you able to resolve this. Unhandled Promise rejection: No provider for Store! ; Zone: ; Task: Promise.then ; Value: Error: No provider for Store! The order I am using is |
@akash6190 I don't know why but now its gone. May be you should check other comment. |
@sandangel yeah I checked, I was not importing from src and it was still throwing the error, but it stopped throwing error when i used ng serve --aot . |
Remove `JavaScript` from `src` folder as this is not required by the consumers and in some cases with `Angular 4.x.x` and `@ngtools/webpack` it causes the `src` to be bundled togather with the `FESM`. With Angular 4 and Webpack the javascript in `src` is being used rather than the FESM. Relates: ngrx#184
Remove `JavaScript` from `src` folder as this is not required by the consumers and in some cases with `Angular 4.x.x` and `@ngtools/webpack` it causes the `src` to be bundled togather with the `FESM`. With Angular 4 and Webpack the javascript in `src` is being used rather than the FESM. Relates: ngrx#184
@akash6190 Did you find the real issue / solution here, in my case also non aot build throws same error. |
@brandonroberts Kindly look into this.. When I am importing StoreModule in app module
Below error is coming, kindly help me to resolve this....
|
@SheriffKhan please open a new issue (I don't think it's related to the discussion above). |
still getting the error |
I'm submitting a...
What is the current behavior?
EffectsModule, StoreRouterConnectingModule and StoreDevtoolsModule need to be imported only after StoreModule, otherwise it does not work.
Expected behavior:
The order of the imports describe above in the app.module or feature module should not matter.
Minimal reproduction of the problem with instructions:
In the app.module or feature module, import EffectsModule or StoreRouterConnectingModule or StoreDevtoolsModule before StoreModule. Effects, storeRouter and devTools will not work.
Version of affected browser(s),operating system(s), npm, node and ngrx:
ngrx v4
Other information:
Issue opened due PR #182
💗 ngrx? Please consider supporting our collective: 👉 donate
The text was updated successfully, but these errors were encountered: