Skip to content

Cannot read properties of null if state is proxied #34

@Canos

Description

@Canos

Hi, im trying to migrate from @angular/redux to this new version.

Everything worked fine after some dependency upgrades.
I'm using at the moment:

  • angular 15.2.10
  • node 18.10.X
  • redux 4.2.1
  • RxJs 7.8.0
  • @angular-redux2/core 5.0.2

When launching the application an error is raised after my state has become a proxy of my state.

error.handler.ts:16 Error: Uncaught (in promise): TypeError: Cannot read properties of null (reading '_isProxy')
TypeError: Cannot read properties of null (reading '_isProxy')
    at Object.get (angular-redux2-store.mjs:145:71)
    at checkoutReducer (checkout.reducer.ts:68:28) // <- my reducer
    at combination (redux.js:560:29)
    at ReducerService.produce (angular-redux2-store.mjs:164:28)
    at angular-redux2-store.mjs:64:29
    at next (angular-redux2-store.mjs:118:20)
    at ReducerService.subStoreRootReducer (angular-redux2-store.mjs:106:16)
    at next (angular-redux2-store.mjs:118:20)
    at ReducerService.executeMiddlewareChain (angular-redux2-store.mjs:120:16)
    at angular-redux2-store.mjs:68:25
    at resolvePromise (zone.js:1193:31)
    at resolvePromise (zone.js:1147:17)
    at zone.js:1260:17
    at _ZoneDelegate.invokeTask (zone.js:402:31)
    at core.mjs:23896:55
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:23896:36)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Object.onInvokeTask (core.mjs:24197:33)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Zone.runTask (zone.js:173:47) '[object Error]'

Store initialization is exactyle the same as it's in the getting started page.
A StoreModule that has the ngRedux.configureStore call.
I already disabled devTools just in case, but the error keeps raising.

In this three screenshot you can see how the state is "proxied" after a particular redux action @@redux/PROBE_UNKNOWN_ACTION_*.

Before, that state is well typed
Screenshot from 2023-12-19 18-09-39

State is already proxied
Screenshot from 2023-12-19 18-09-47

My first action comes in and an error will raise
Screenshot from 2023-12-19 18-10-03

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions