Error in creating WebSocket connection
See original GitHub issueHello! I am getting an error in generating a WebSocket connection, specifically:
Uncaught DOMException: Failed to construct 'WebSocket': The URL 'undefined' is invalid.
I’ve done a little source-diving, and it appears to be a mismatch between the output to SubscriptionClient
of subscriptions-transport-ws
and the input to WebSocketLink
from apollo-link
. It seems that SubscriptionClient
has a url
property, but WebSocketLink
is looking for uri
:
Does this seem like a bug, or am I missing something else here?
This issue pertains to the following package(s):
- GraphQL Playground - Electron App
- GraphQL Playground HTML
- GraphQL Playground
- GraphQL Playground Express Middleware
- GraphQL Playground Hapi Middleware
- GraphQL Playground Koa Middleware
- GraphQL Playground Lambda Middleware
What OS and OS version are you experiencing the issue(s) on?
macOS High Sierra
What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?
v1.5.7
What is the expected behavior?
No errors in WebSocket connection.
What is the actual behavior?
Error in creating a WebSocket connection.

What steps may we take to reproduce the behavior?
Unknown yet.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:9
Top Results From Across the Web
WebSocket: error event - Web APIs | MDN
The error event is fired when a connection with a WebSocket has been closed due to an error (some data couldn't be sent...
Read more >WebSockets - Handling Errors
WebSockets - Handling Errors, Once a connection has been established between the client and the server, an open event is fired from the...
Read more >How to resolve the error: "Could not open websocket connection
For the AWS ELB's Classic Load Balancer: The problem will be due to Classic Load Balancer's HTTP protocol not passing along WebSocket requests....
Read more >Error in creating WebSocket connection · Issue #600 - GitHub
Hello! I am getting an error in generating a WebSocket connection, specifically: Uncaught DOMException: Failed to construct 'WebSocket': The URL ...
Read more >WebSocket connection failed: Error during ... - Stack Overflow
I just realized that websockets is working partially. I see a 101 Switching Protocols request in the Chrome developer console. However the only ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m not creating the link in my own code though, I’m just using the
<Playground/>
component.I seem to have been able to avoid the problem, based on the hint in this comment, I’ve added to package.json:
experiencing same problem as @eliperelman , was a fix done ?