-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weird initialState of redux-toolkit in next js 13 #3154
Comments
Take a look at the dropdown in the top right. That is not the internal state of the web site you are building, but the internal state of some "Free Gift Card Generator" - maybe another tab you have open or a browser plugin that injected itself into your site? |
Yeah thats im building and its correct |
Still, have you checked that dropdown if there are any other stores in there that could actually be your Redux store that you are building? There can sometimes be multiple stores on one page, often accidentally. |
yes i check there is no other instance working. I generally don't open many tabs |
you can come to my desktop and fix this thing by yourself |
Did you accidentally import the wrong reducer in your store setup? Possibly from Please share your store setup file here, including imports. |
Yeah, that specifically looks like https://github.com/vercel/next.js/blob/4e2267ff61bcee74c26f16ec7675bf29338af141/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts#L37 . That tells me what you're looking at is definitely not your own application code somehow. |
Store setup seems fine. Honestly, this just looks like the DevTools are somehow showing something that's not part of your app, and that's not an issue with RTK itself. I'd double-check to see if there are any other options listed in the "Instances" dropdown menu. |
okie thankx |
Folks, whatever's going on here is not actually a Redux Toolkit problem specifically. If anything, it's a Redux DevTools problem. Your best bet is to file an issue in the Redux DevTools repo, with an app repo that demonstrates this problem happening. |
Short update: Looking at https://github.com/vercel/next.js/commits/canary/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts , it does look like the Next folks have been working on this file recently. Per https://github.com/vercel/next.js/blob/0d7f7653e81a4f2aa16be7ead286e09b22761f52/packages/next/src/client/components/app-router.tsx#L32 , they also have a I've asked them if they made any recent changes that might be affecting the DevTools, but overall this looks like it's a Next-related bug. |
Update: confirmed that this is a Next bug. They tried to wrap I've passed along a suggestion to have them fix that and call the Redux DevTools |
Fixes reduxjs/redux-toolkit#3154 Thanks @markerikson for helping out on this one. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
i tried everything as per tutorial and connect my next js 13 with the provider with redux-toolkit but Im getting weird state not the state I defined. My code is exactly like the counter tutorial on react redux documentation. Anyone solution I was expecting a state with a counter variable with a value of zero.
The text was updated successfully, but these errors were encountered: