-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Server-Side Rendering Error with @apollo/client 3.11.0 in NextJS 14.2.5 #11976
Comments
Hey @apshenichniy 👋 You're right! We did some refactoring in I'll dig into this soon and try and figure out what we did before in the SSR case to ensure we mimic that here. Thanks for bringing this to our attention! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
Hey @apshenichniy 👋 This was just released in 3.11.2. Please upgrade to that version and you should see the error go away. Thanks for reporting this! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
I have a NextJS application using apollo/client v3.11.0. the following error occurs during server-side rendering:
Error: Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering. at Object.useSyncExternalStore (/var/task/node_modules/.pnpm/next@14.2.5_@babel+core@7.24.5_@playwright+test@1.45.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:41308)
The snippet below triggered an error:
The error seems to be related to the implementation of the useSubscription hook. Specifically, it appears that the third parameter (callback for getServerSnapshot) is not being passed to the useSyncExternalStore hook:
[Link](
apollo-client/src/react/hooks/useSubscription.ts
Line 221 in 3d9eb47
Downgrading to @apollo/client version 3.10.8 resolves the issue.
Link to Reproduction
/
Reproduction Steps
No response
@apollo/client
version3.11.0
The text was updated successfully, but these errors were encountered: