-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Unable to resolve unstable_batchedUpdates from react-dom #5023
Comments
|
https://github.com/Elementrat/hwatu
|
okay yeah this is a reproduction, but it's far from minimal. I don't know of if it's app directory related, or if any of the other dependencies have something to do with it. Please try to narrow it down. I pretty much deleted everything except one page and the so you can either add more things to my repro until it breaks or remove stuff from yours until it works |
Running into the same problem. Dont have a repro yet. FWIW @TkDodo you have next version 13.1 in your sandbox. Not sure if 13.2 makes a difference here |
Ok was able to dig into this more and seems like Nextjs changes what ReactDOM exports on server side? Not sure, but after a few console logs, I cannot get |
Following along with this issue. I encountered this as well, when I spotted this comment. I moved my |
This is a partly related Next.js issue: vercel/next.js#43690 |
I don't see any relation to react-query here. The minimal reproduction I provided works, so if someone wants to work from that to show that it doesn't work in a minimal way with react-query, we can re-open this. |
@TkDodo |
@mrzachnugent it works if I remove the following line:
To me, this looks like a nextJs problem. |
Fair enough. Thanks |
By any chance if you are using NextJS Edge runtime causes this problem as apparently it creates its own So just remove in file generally its written as
or
Remove these from the file or replace |
This is part of the lighter weight SSR runtime in React which doesn't export this since a noop in React 18. However, we're going to re-add it as a noop for compat and not break the light SSR runtime. Which will then get upgraded in Next.js. So no change needed from react-query. |
tracking PR facebook/react#27028 |
pnpm remove next |
Describe the bug
Hi!
In the context of a Next 13 project, I'm able to use react-query in local dev, but production builds fail with the following error:
./node_modules/.pnpm/@tanstack+react-query@4.24.10_biqbaboplfbrettd7655fr4n2y/node_modules/@tanstack/react-query/build/lib/reactBatchedUpdates.mjs Attempted import error: 'unstable_batchedUpdates' is not exported from 'react-dom' (imported as 'ReactDOM').
Dependencies:
"dependencies": { "@apollo/client": "3.7.8", "@apollo/server": "4.4.0", "@as-integrations/next": "1.2.0", "@graphql-tools/schema": "9.0.16", "@heroicons/react": "1.0.6", "@tailwindcss/forms": "0.5.3", "@tailwindcss/line-clamp": "0.4.2", "@tanstack/query-core": "4.24.10", "@tanstack/react-query": "4.24.10", "axios": "1.3.3", "clsx": "1.2.1", "date-fns": "2.29.3", "dinero.js": "2.0.0-alpha.8", "graphql": "16.6.0", "graphql-request": "5.1.0", "graphql-tag": "2.12.6", "graphql-tools": "8.3.18", "jotai": "2.0.2", "jotai-tanstack-query": "0.5.0", "mongodb": "5.0.1", "ms": "3.0.0-canary.1", "next": "13.1.7-canary.21", "react": "18.2.0", "react-dom": "18.2.0", "styled-components": "6.0.0-beta.2", "swr": "2.0.3", "use-count-up": "3.0.1" },
Curious whether this is a known issue...
Your minimal, reproducible example
N/A - only build step fails
Steps to reproduce
pnpm run build
Expected behavior
Build completes successfully
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
Mac OS
TanStack Query version
"@tanstack/query-core": "4.24.10", "@tanstack/react-query": "4.24.10",
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: