SSR build fails
GitHub
Not able to build Vite (SSR) with react-query ยท Issue #4215 ยท TanSt...
Describe the bug This small example fails when running yarn serve (essentially yarn build && yarn serve): https://github.com/duerdod/react-query-vitejs.git. The build works fine whe...
3 Replies
ambitious-aquaโข4y ago
Issue seems to be react-query is loading the development version of react-domreact-query doesn't decide which version (prod or dev) it loads - we just import react like everybody else ๐คทโโ๏ธ. So it seems more like an issue for the bundler...
like-goldOPโข4y ago
Hm, yeah probably, but using
@tanstack/query-core seems to work tho? But the QueryClientProvider aint available in there since it's react specificambitious-aquaโข4y ago
react-query has react dom as optional peerDependency because you could also use it with react native
Maybe the bundler doesn't like that
The query-core doesn't depend on react at all