Minified Redux error #3; You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store. #5166
VojtechMoravek
started this conversation in
General
Replies: 1 comment
-
|
This is one of those errors that ought to only happen if there's a real bug in the app. That said, I do see the stack traces indicating this is coming from RTKQ. Unfortunately I don't think we'll be able to do any investigation here unless there's an actual repro to look at. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
On 4 different occasions we have gotten an error reported to sentry about
Minified Redux error #3.The description for this error is:
You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.In all of these sentry errors, the stack trace ends
node_modules/redux/dist/redux.mjs. For 2 of these errors, no part of the trace contains anything from our own code.This image is from 2 months ago, it happened in Firefox 140.0 on Windows 10+, React 18.3.1, Redux Toolkit 2.8.2

This image is from today, it happened in Firefox 145.0 on Windows 10+, React 18.3.1, Redux Toolkit 2.11.1

Both of the above errors also have another corresponding error that got reported at the same time that actually has some of or own code. For privacy purposes, I won't share the actual code.
This one is from 2 months ago (Firefox 140.0 on Windows 10+, React 18.3.1, Redux Toolkit 2.8.2). The first obfuscated file simply calls a custom hook. The other confuscated file (the actual hook) calls

useSelector(selectThing). TheselectThingselector looks as follows:selectThing: (state) => state.thing.This one is from today (Firefox 145.0 on Windows 10+, React 18.3.1, Redux Toolkit 2.11.1). The obfuscated file simply calls

useSelector(selectAnotherThing). TheselectAnotherThingselector is defined as:selectAnotherThing: (state) => state.anotherThingI was not able to reproduce this issue. I found that it could be something with
redux-devtools-extension(zalmoxisus/redux-devtools-extension#588, https://stackoverflow.com/questions/51503198/error-you-may-not-call-store-getstate-while-the-reducer-is-executing) but have no idea if it actually could be this. I unfortunately do not know if the user had any extensions installed/enabled.Does anyone have any idea where to look and what to look for in order to fix this issue? As far as I can tell, it actually only ever happened 2 times (both of which reported 2 errors to sentry).
Thanks for any tips and advice. I will try to supply more information or code if needed.
Beta Was this translation helpful? Give feedback.
All reactions