'Error Cannot read properties of undefined 'Symbol(immer-state)'
Build simple project with ROR and React/Redux RTK. Locally works fine. Also with heroku local. But once I upload to Heroku, when I'm modyfing state with Redux I see error. Completely don't know what to do with it.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Symbol(immer-state)')
From stack I see that it happens somewhere around EntityAdapter function call .addOne and .removeOne. While /setAll, and .upsertOne works fine...
Reducer:
extraReducers: (builder) => {
builder
.addCase(fetchTodos.fulfilled, (state, action) => {
state.status = "succeeded";
todosAdapter.setAll(state, action);
})
.addCase(fetchTodos.pending, (state, action) => {
state.status = "loading";
})
.addCase(createTodo.fulfilled, (state, action) => {
todosAdapter.addOne(state, action);
})
.addCase(updateTodo.fulfilled, (state, action) => {
todosAdapter.upsertOne(state, action);
})
.addCase(deleteTodo.fulfilled, (state, action) => {
todosAdapter.removeOne(state, action.payload.id);
});
},
Solution 1:[1]
Fixed it by turning off uglification via Rails:
production.rb
# config.assets.js_compressor = :uglifier
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | zapala.grzegorz |
