-
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
AC3: using @apollo/client/link/schema breaks SSR #6614
Comments
workaround is to patch @apollo/client and disable the check:
it could be a problem with commonjs vs esm. But since we don't use graphql directly, its a mess between @apollo/client and some other package. EDIT: this seems only to work with dev build, not prod :-( it now throws an error:
|
i guess the problem happens whenever you use @apollo/client directly under nodejs (and not compiled to browser) |
downgrading to 3.0.0-rc.3 solves the issue this also involes to to readd and use these packages:
i can try to bisect until i find the broken version Edit: well... it works also with current version. But problem is: using |
@macrozone See #6624, coming soon in 3.0.2! |
This should now be fixed in |
@benjamn wow thx! Edit: yes, it fixes the issue! |
I'm facing the same issue as OP, except under different circumstances. I am using the schema link client side to mock queries and mutations that we don't currently have data for. I have tried everything from module resolutions (yarn), to listing dependencies and making sure they're all using the same graphql module, deduping.. etc. This happens on |
Still facing this issue with - 3.2.5 |
Edit: i found the culprit: its
@apollo/client/link/schema
workaround is to use
"@apollo/link-schema": "^2.0.0-beta.3",
instead.This problem arises if you bypass the network in SSR by using link-schema on the server instead of normal http-link.
Original post:
When doing SSR (in a nextjs project), you get this error:
i made sure that i only have one version of
graphql
in my yarn.lock. I tried multiple versions without luck (14.7.0 and 15.3.0)Intended outcome:
SSR should work
Actual outcome:
see error above
How to reproduce the issue:
using apollo-client with ssr. Same problem happens if i do snapshot testing with jest
Versions
System:
OS: macOS 10.15.5
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
Browsers:
Chrome: 83.0.4103.116
Firefox: 76.0.1
Safari: 13.1.1
npmPackages:
@apollo/client: ^3.0.1 => 3.0.1
apollo-server-micro: ^2.15.1 => 2.15.1
apollo-upload-client: ^13.0.0 => 13.0.0
next-with-apollo: ^5.1.0 => 5.1.0
The text was updated successfully, but these errors were encountered: