I want to add a library to my Nx Angular project. I added the module in the imports of AppModule
. I also had to add StoreModule.forRoot()
and EffectsModule.forRoot()
. The error occurs when launching the application. I don’t understand what might be causing it.
I know the lib works has it is used in another lib. I tried to reproduce implementation without success.
AppModule.ts :
@NgModule({
declarations: [AppComponent],
imports: [
StoreModule.forRoot(),
EffectsModule.forRoot(),
MyModule.forRoot(),
...
],
Error:
main.ts:14 TypeError: Cannot read properties of undefined (reading
‘0’)
Main.ts line 14 :
platformBrowserDynamic().bootstrapModule(AppModule);
Full error in console:
main.ts:14 TypeError: Cannot read properties of undefined (reading
‘0’)
at ngrx-store.mjs:1341:51
at Array.map ()
at Object.featureStateProviderFactory [as useFactory] (ngrx-store.mjs:1338:28)
at Object.factory (core.mjs:3322:38)
at core.mjs:3219:47
at runInInjectorProfilerContext (core.mjs:866:9)
at R3Injector.hydrate (core.mjs:3218:21)
at R3Injector.get (core.mjs:3082:33)
at injectInjectorOnly (core.mjs:1100:40)
at ɵɵinject (core.mjs:1106:60)