question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError when using reducer()

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
younes0commented, Oct 20, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Try to connect Action with Reducer but get Error: Uncaught (in ...
I am using the useEffect useEffect(() => ( fetchUser() ), []). For one, you have to use {} , not () in your...
Read more >
Writing Reducers with Immer | Redux Toolkit - JS.ORG
Redux Toolkit's createReducer and createSlice automatically use Immer internally to let you write simpler immutable ... "mutate" the array by calling push()
Read more >
Array.prototype.reduce() - JavaScript - MDN Web Docs
The reduce() method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value ...
Read more >
cannot read properties of undefined (reading 'type') redux
The first arg should be the reducer. The second arg is initial state. Since you're passing reducer as initial state, that's why you're...
Read more >
Try to connect Action with Reducer but get Error: Uncaught (in ...
Coding example for the question Try to connect Action with Reducer but get Error: Uncaught (in promise) TypeError: dispatch is not a function-Reactjs....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found