When I add "@ngrx/router-store" to my project, it spams the app console in development mode and unit test results with the following message:
The feature name "router" does not exist in the state, therefore createFeatureSelector cannot access it. Be sure it is imported in a loaded module using StoreModule.forRoot('router', ...) or StoreModule.forFeature('router', ...). If the default state is intended to be undefined, as is the case with router state, this development-only warning message can be ignored.
I tried to set router
state property type to
router: null | RouterReducerState<SerializedRouterStateSnapshot>
and initial state value to
router: null
but it clashes with routerReducer
type, which only accepts
RouterReducerState<SerializedRouterStateSnapshot>
How do I disable this warning? I honestly find it rather annoying.