This issue is regarding tests. You can clone this simple example here: https://github.com/Fallenstedt/users-ngrx
The effect uses withLatestFrom to pipe off the store and obtain data in the store.
Removing or adding withLatestFrom in the effect will make the test pass or fail respectively.
The error I see when I have an effect using withLatestFrom is
{
"message": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'loaded' of undefined thrown",
"str": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'loaded' of undefined thrown"
}
I would expect tests to pass when my effect uses withLatestFrom
"@angular/core": "^7.0.0",
"@ngrx/effects": "7.4.0",
"@ngrx/entity": "^7.4.0",
"@ngrx/router-store": "7.4.0",
"@ngrx/store": "7.4.0",
node: v9.8.0
This issue references #414. Other people still have problems with this when using ngrx v7
[X] Yes!!!!!!!!!!!!!!!!!! (Assistance is provided if you need help submitting a pull request)
I dont think this is an issue with NGRX or your test setup,
In the example you have provided https://github.com/Fallenstedt/users-ngrx
You have defined your state as:
{ user: UsersState }
but you are loading in your feature state as export const USERS_FEATURE_KEY = 'users';
changing either your feature state to user or your state interface to users will solve your issue?
EDIT:
ive just tested it and its correct, your state/definitions are incoherent, follow the tip above to rectify

@King-i I cannot thank you enough. Last night I was so confused as to why I could not get my effects to to run properly. A single missing character led to so much confusion. I need to use my USERS_FEATURE_KEY liberally.
This is a classic "D'oh!" moment. I applied changes, and my tests work properly now.
Thank you for your help.
Most helpful comment
I dont think this is an issue with NGRX or your test setup,
In the example you have provided https://github.com/Fallenstedt/users-ngrx
You have defined your state as:
{ user: UsersState }but you are loading in your feature state as
export const USERS_FEATURE_KEY = 'users';changing either your feature state to

useror your state interface touserswill solve your issue?EDIT:
ive just tested it and its correct, your state/definitions are incoherent, follow the tip above to rectify