Does not work with edge runtime #5575
Send to my agentDescribe the bug#
Setting a page to use edge-runtime does not work. This is a big blocker for deploying to cloudflare pages.
Failed to compile.
./node_modules/.pnpm/@tanstack+react-query@4.29.12_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-query/build/lib/reactBatchedUpdates.mjs
Attempted import error: 'unstable_batchedUpdates' is not exported from 'react-dom' (imported as 'ReactDOM').
Import trace for requested module:
./node_modules/.pnpm/@tanstack+react-query@4.29.12_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-query/build/lib/reactBatchedUpdates.mjs
./node_modules/.pnpm/@tanstack+react-query@4.29.12_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-query/build/lib/setBatchUpdatesFn.mjs
./node_modules/.pnpm/@tanstack+react-query@4.29.12_react-dom@18.2.0_react@18.2.0/node_modules/@tanstack/react-query/build/lib/index.mjs
./src/@trpc/next-layout/client/createHydrateClient.tsx
./src/@trpc/next-layout/client/index.ts
./src/lib/api/client.ts
./src/app/(dank)/layout.tsx
Your minimal, reproducible example#
Github
Steps to reproduce#
Clone a nextjs repo using tanstack query https://github.com/ploskovytskyy/next-app-router-trpc-drizzle-planetscale-edge
Add export const runtime = "edge"; to any page.tsx file that imports api
Expected behavior#
Should work on edge runtime
How often does this bug happen?#
None
Screenshots or Videos#
No response
Platform#
V8 engine
Tanstack Query adapter#
None
TanStack Query version#
4.29.12
TypeScript version#
No response
Additional context#
No response
TkDodo closed this
TkDodo added labelsv5
Sign in to join this conversation.
how is this a bug in react-query? According to an issue we had too long ago:
Anyways,
unstable_batchedUpdatesis removed in v5.