You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We see in our server logs many of these 2 FATAL Errors on production and on non-production environments:
FATAL [main.js:xx] NgxsSelectSnapshotModuleIsNotImported [Error]: You've forgotten to import "NgxsSelectSnapshotModule"! at assertDefined (/opt/app/dist/server/main.js:xx:yy) at getStore
FATAL [main.js:xx] Error: You have forgotten to import the NGXS module! at createSelectObservable (/opt/app/dist/server/main.js:1:yy)
We clearly have imported both ngxs modules in AppModule and in the Feature Modules.
In App module:
It is a very huge project with many modules and components... And the errors are only happening via SSR, and there it happens rarely on our dev machines... When it does, though, we see a LOT of Error statements successively while no other component or module is complaing with an error. It is just ngxs.
It seems, that SSR still deliveres the html, and the Angular app loads still well on the client (including all ngxs stuff)
🔬 Minimal Reproduction
Ok. We found out how to reproduce:
open a page in browser
refresh
quickly abort loading
quickly refresh again
--> many many FATAL Errors
Guess: This might be caused by angular destroying all stuff and both ngxs modules will clear the Injector onDestroy.
As the errors happens ONLY when we reload quickly after aborting (just aborting never creates the errors), it must be sth about angular universal still (re-?) using some components while ngxs already got rid of its injector reference.
🔥 Exception or Error
FATAL [main.js:2897] NgxsSelectSnapshotModuleIsNotImported [Error]: You've forgotten to import "NgxsSelectSnapshotModule"!
at assertDefined (/opt/app/dist/server/main.js:2897:xx)
at getStore (/opt/app/dist/server/main.js:2897:xx)
at XXXComponent.get [as isXXX] (/opt/app/dist/server/main.js:2897:xx)
at XXXComponent_Template (/opt/app/dist/server/main.js:2897:xx)
at executeTemplate (/opt/app/dist/server/main.js:2897:xx)
at refreshView (/opt/app/dist/server/main.js:2897:xx)
at refreshComponent (/opt/app/dist/server/main.js:2897:xx)
at refreshChildComponents (/opt/app/dist/server/main.js:2897:xx)
at refreshView (/opt/app/dist/server/main.js:2897:xx)
at refreshComponent (/opt/app/dist/server/main.js:2897:xx)
or....
FATAL [main.js:2897] Error: You have forgotten to import the NGXS module!
at createSelectObservable (/opt/app/dist/server/main.js:1:xx)
at AppComponent.get [as progress] (/opt/app/dist/server/main.js:1:xx)
at AppComponent_Template (/opt/app/dist/server/main.js:2897:1625353)
at executeTemplate (/opt/app/dist/server/main.js:2897:xx)
at refreshView (/opt/app/dist/server/main.js:2897:xx)
at refreshComponent (/opt/app/dist/server/main.js:2897:xx)
at refreshChildComponents (/opt/app/dist/server/main.js:2897:xx)
at refreshView (/opt/app/dist/server/main.js:2897:xx)
at renderComponentOrTemplate (/opt/app/dist/server/main.js:2897:xx)
at tickRootContext (/opt/app/dist/server/main.js:2897:xx)
Environment
Libs:
"@angular/core": "^11.0.6",
"@ngxs/store": "^3.7.1",
"@ngxs-labs/select-snapshot": "^2.0.1",
Browser: only on SSR
The text was updated successfully, but these errors were encountered:
Guess: This might be caused by angular destroying all stuff and both ngxs modules will clear the Injector onDestroy.
As the errors happens ONLY when we reload quickly after aborting (just aborting never creates the errors), it must be sth about angular universal still (re-?) using some components while ngxs already got rid of its injector reference.
Description
We see in our server logs many of these 2 FATAL Errors on production and on non-production environments:
We clearly have imported both ngxs modules in AppModule and in the Feature Modules.
In App module:
in Feature Module:
It is a very huge project with many modules and components... And the errors are only happening via SSR, and there it happens rarely on our dev machines... When it does, though, we see a LOT of Error statements successively while no other component or module is complaing with an error. It is just ngxs.
It seems, that SSR still deliveres the html, and the Angular app loads still well on the client (including all ngxs stuff)
🔬 Minimal Reproduction
Ok. We found out how to reproduce:
Guess: This might be caused by angular destroying all stuff and both ngxs modules will clear the Injector onDestroy.
As the errors happens ONLY when we reload quickly after aborting (just aborting never creates the errors), it must be sth about angular universal still (re-?) using some components while ngxs already got rid of its injector reference.
🔥 Exception or Error
Environment
The text was updated successfully, but these errors were encountered: