You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, getDataFromTree is meant for "classic" SSR, not the new renderTo*Stream methods React provides.
Unfortunately, React itself is missing the necessary features that any data fetching library could support the modern streaming SSR out of the box without framework-specific hacks. We are talking with the React team, they are aware of the problem, but I don't expect a solution from their side soon.
In the meantime, we need to rely on framework-specific hacks, and I am currently working on a helper package for React Router 7 over here: apollographql/apollo-client-nextjs#394
I hope to get something shipped for this within the next few weeks, but we also rely on some PRs to land in React Router, so I can't give you a definitive timeline.
Issue Description
When adding Apollo client to a react-router v7 app with SSR, the following error is encountered when handling the server side request:
Link to Reproduction
https://stackblitz.com/~/github.com/craigsmitham/react-router-apollo-client
Reproduction Steps
See stackblitz and github repo for more details.
This repro case was created by:
npx create-react-router@latest react-router-apollo-client
npx react-router reveal
entry.server.tsx
based on guidance for Remix in https://www.apollographql.com/blog/how-to-use-apollo-client-with-remixTo reproduce the issue, simply run
npm run dev
and visit dev server http://localhost:5173 and observe the following error:More information:
This error appears to be triggered when the
getDataFromTree(App)
line is called: https://github.com/craigsmitham/react-router-apollo-client/blob/1cb7514b7403a456bc141ef1e5b658e1cfb13b91/app/entry.server.tsx#L44C1-L44C32@apollo/client
version3.12.4
The text was updated successfully, but these errors were encountered: