-
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
on error ReferenceError: WebSocket is not defined #11761
Comments
Hi @arenevier 👋 Appreciate the bug report! What does the error event you're receiving look like? Are you using |
any type of error will create that. For example:
Yes, I'm using ws,
|
Thanks, @arenevier. You should also set that |
Yes, that would work. It looks like I am not the first to bump into this issue: #11063 Should that be specified in the documentation? Alternatively, replacing WebSocket.CLOSED by it's value (3) would also fix the issue for everyone. |
Yes, that should definitely be added to the docs :) I'll look at opening that PR today. |
Issue Description
I am using apollo client with GraphQLWsLink in node.
When an error happens, an exception happens during the handling of that error
Trace is
This happens because of that line. WebSocket is not defined in node environment.
return isNonNullObject(err) && err.target?.readyState === WebSocket.CLOSED;
Link to Reproduction
don't have one, but the root of the issue is obvious
Reproduction Steps
No response
@apollo/client
version3.9.10
The text was updated successfully, but these errors were encountered: