Easy-peasy: TypeError when using reducer()

Created on 27 Jul 2020  路  10Comments  路  Source: ctrlplusb/easy-peasy

When I import this reducer https://github.com/prescottprue/redux-firestore/blob/master/src/reducer.js

import { firestoreReducer } from 'redux-firestore'

const store = createStore(
  {
    firestore: reducer(firestoreReducer)
  }
)

I get

immer.module.js:211 Uncaught TypeError: 'ownKeys' on proxy: trap result did not include 'i'
    at Function.freeze (<anonymous>)
    at freeze (immer.module.js:211)
    at Immer.maybeFreeze (immer.module.js:1616)
    at Immer.processResult (immer.module.js:1456)
    at Immer.produce (immer.module.js:1348)
    at Object.queriesReducer [as queries] (queriesReducer.js:85)
    at reducers.js:60
    at Array.reduce (<anonymous>)
    at reducers.js:59
    at index.js:30 
    ...

This doesn't happen when I disable immer.

Tested on 3.3.1 & 3.4.0-beta

needs-investigation

All 10 comments

I managed to make it work by commenting this line in redux-firestore's own immer module

image

What's the problem ?

Thanks for the report @younes0

This is an interesting case. I'll definitely mark it for investigation.

Hey @younes0

Would you be able to try the latest alpha to see if this is resolved? I create an isolated instance of Immer now, so it may be okay.

npm install [email protected]

Closing this. Please keep me posted if it is still an issue. 馃憤

@ctrlplusb hey Sean! sorry just started a new work

I get a different error now:

```
Uncaught TypeError: Cannot perform 'getPrototypeOf' on a proxy that has been revoked
at Function.getPrototypeOf ()

Hey @younes0, no worries. Didn't mean to seem like I was pressurizing you. I just prefer to close things I am not actively needing to look at to maintain my sanity. 馃槄

Oh dear, this is disappointing. Would you be able to help create a minimal reproduction for me in codesandbox?

@ctrlplusb aha okay, it makes sense 馃憤
sure I've started already, will update once it's finished, before next week.

thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebadta81 picture ebadta81  路  3Comments

giacomorebonato picture giacomorebonato  路  5Comments

ctrlplusb picture ctrlplusb  路  5Comments

positimo picture positimo  路  3Comments

rmariuzzo picture rmariuzzo  路  6Comments