ERROR in Error during template compile of 'AppModule'
or just change " [authKey]: authReducer," to 'auth': authReducer,
I also faced the same error, and in my case, it was just a typo in my module. I had one comma "," in the module's provider's array. Try to remove the comma after contentReducer from your code.
Had the same problem... try to use an injection token to provide the ActionReducerMap.
export const reducers: ActionReducerMap<ICommonAppState> = {
[authKey]: authReducer,
[configKey]: configReducer,
[navigationKey]: navigationReducer,
[contentKey]: contentReducer,
};
export const REDUCERS_TOKEN = new InjectionToken<ActionReducerMap<ICommonAppState>>('App Reducers');
export const reducerProvider = { provide: REDUCERS_TOKEN, useValue: reducers };
and then use it like this
imports: [
...
StoreModule.forRoot(REDUCERS_TOKEN, { metaReducers }),
...
],
providers: [reducerProvider]
And the AOT compiler should then hopefully be able to analyze the code statically (without excecuting it).