store-devtools icon indicating copy to clipboard operation
store-devtools copied to clipboard

Action type: '@ngrx/store/update-reducers'

Open chekit opened this issue 7 years ago • 4 comments

I'm faced with strange behaviour by @ngrx/store-devtools.

Environment:

  • Windows 10 Pro
  • Chrome Version 63.0.3239.132
  • Node v6.11.3, Node v8.9.4
  • Project generated with Angular CLI v1.5.0,
  • Angular v5.1.3

Problem

If I'm using this packages with corresponding versions:

    "@ngrx/effects": "^4.1.1",
    "@ngrx/store": "^4.1.1",
    "@ngrx/store-devtools": "^5.0.0",

When I'm opening Redux Devtools in Chrome among my Actions stack there is one with type @ngrx/store/update-reducers. That action causes the app to fail, cause the last action in stack has state as undefined. If I click 'skip' on that action (@ngrx/store/update-reducers) the app starts working normally and every action will have its proper state.

If I'm changing version to 4.0.0. everything works properly without any side actions.

    "@ngrx/effects": "^4.1.1",
    "@ngrx/store": "^4.1.1",
    "@ngrx/store-devtools": "4.0.0",

chekit avatar Jan 25 '18 07:01 chekit

Encountering this exact issue, however I am using "@ngrx/store": "5.0.0"

drew-codes avatar Jan 30 '18 15:01 drew-codes

Could it be that one of your reducers is not returning the unmodified state for unknown actions in the default clause of an action switch?

Halt001 avatar Feb 02 '18 16:02 Halt001

@Halt001 For my case I have added a default clause for all reducers and got the issue with @ngrx/store/update-reducers If you interested you can check the demo app where I fist faced with that issue: https://github.com/chekit/ngrx-101/tree/final/src/app/store/reducers (branch final)

chekit avatar Feb 03 '18 09:02 chekit

I see what you mean. You don't have to skip @ngrx/store/update-reducers to make it work again. If you toggle skip on the last action in the stack the state is no longer undefined and it also starts working again.

Another observation is that when viewing the last action on the stack the state is undefined but the diff says states are equal, which isn't true. Also the last action in the stack is displayed in a slightly dimmed grey so it looks like some processing hasn't finished yet.

Halt001 avatar Feb 03 '18 09:02 Halt001