Open elegon32 opened 3 years ago
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.
This is the same issue as further explained here: https://github.com/ngxs/store/issues/1723
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