The setup:
- MongoDB (Atlas or local)
- Backend: NestJS, OAS, using swagger-codegen to package 'backend client' for...
- Angular 15 + Material Design + Ngrx (store + effects)
Recently I added the state manage work using Ngrx and when I add the EffectsModule I get this error:
Error: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with
EnvironmentInjector#runInContext
.
Issue began when adding EffectsModule to import (line 36) of app.module.ts
I continue my research of this, and would appreciate any thoughts or insights. Based on this SO article (1) the error appears generic. I am open to ideas of how to chase this down.
Repo branches necessary to replicate environment:
Other SO articles I have come across:
- Angular upgrade - Error: inject() must be called from an injection context at injectInjectorOnly
- inject() must be called from an injection context when using angular library in ionic project
Causes error to change to: NullInjectorError: NullInjectorError: No provider for Store!
LATEST:
I suspected that the typescript being generated by the openapitools/openapi-generator-cli is no longer sufficient whilst including the ngrx work. I did find the typescript-angular generator in the list of generator and will give this a try...