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.

Updating notification throws state mutation error with redux-toolkit

See original GitHub issue

Description

When updating notification, redux-toolkit throws error : Invariant failed: A state mutation was detected between dispatches, in the path 'notifications.0.status' I had to disable immutableCheck middleware for notifications in redux store.

Expected behavior

Dispatching notify should return a new object instead of state reference, I suppose.

Steps to reproduce the bug

Configuring store as the documentation

Environment

  • OS name and version : MacOS 10.15.7
  • Browser name and version: All
  • Reapop version: 3.0.4

Additional information

  • I can fix this bug

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LouisBarranqueirocommented, Aug 18, 2021

👋 guys, new version should fix this problem. Please re-open the issue if you still have an issue.

0reactions
NeXTscommented, Sep 7, 2022

👋 guys, new version should fix this problem. Please re-open the issue if you still have an issue.

Hello, I get mutation error updating notification in Class component.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Handling | Redux Toolkit
If your query or mutation happens to throw an error when using fetchBaseQuery, it will be returned in the error property of the...
Read more >
React and Redux: Uncaught Error: A state mutation was ...
Solved the problem with state mutations by following any of the update patterns suggested on redux official docs.
Read more >
RTKQ: Mutation gets stuck in 'Pending' despite rejection from ...
Hi,. On multiple places, since I've updated our package the mutation is stuck on 'Pending' even when an error is thrown.
Read more >
Robust React App Notification System using MUI and Redux ...
Create A Robust Notification System For Your React App In Less Than 100 Lines Of Code. Using Redux toolkit, MUI, and React hooks, ......
Read more >
Centralizing API error handling in React apps - ITNEXT
That would involve using apollo-link-state and dispatching a mutation just for the freaking status code update. With this in mind, let's take a ......
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