angular-redux2 / store

integrate your redux store into your Angular
Mozilla Public License 2.0
11 stars 4 forks source link

Cannot read properties of null if state is proxied #34

Open Canos opened 10 months ago

Canos commented 10 months ago

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:

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_UNKNOWNACTION*.

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

pakozlow commented 10 months ago

Hi @Canos , for now I'm maintaining a fork of this repository at https://github.com/pakozlow/store and https://www.npmjs.com/package/@angular-redux3/store respectively. The above mentioned error as well as other issues have been patched in it. Unfortunately the original maintainer no longer updates this repository :(

Canos commented 10 months ago

thanks for answering and thanks for your work, i didnt know your repository exists. I will star it and use it soon. See you soon

Garefild commented 9 months ago

Sorry I had an injury that made me a bit unavailable.

Canos commented 9 months ago

Sorry to hear that Garefil, Take your time to recover, you started this fork and others have taken your work to another level. Proud of you.

Garefild commented 9 months ago

In the coming days, I will release a version with improvements that have not yet been entered.