question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clients can't connect to socket server

See original GitHub issue

Screenshot GraphiQL image uRQL Client - Console image

Expected Behaviour I expected it to do connect the socket server.

Actual Behaviour but instead it did give me error without any response.

Setup For server, I am using ExpressJS with GraphQL-Helix/Envelop

// initial setup with cookies, form data etc.
const server = app.listen(PORT, () => {
    const wsServer = new WebSocketServer({
      path: "/graphql",
      server,
    });

const { execute, subscribe } = getEnveloped({});

useServer(
      {
        execute,
        subscribe,
        onError: writeError,
        onSubscribe: async (ctx, msg) => {
              // this is never called
              // on error is also never called (it is only a logger)

In the error message in console above, the response is undefined. I also tried doing it noServer:true, still I got the same error.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ragokancommented, Apr 6, 2022

Well, let me close the issue for now because it is probably something to do with Heroku or my code, if anybody else got the same error, can always write here.

@enisdenjo Thank you so much for helping that fast.

1reaction
enisdenjocommented, Apr 6, 2022

Ok weird. This error looks like theres a problem with the network, can you confirm you’re using the right URL on the clients (and that the server is available)? Is the server on the same local network? Can you provide me a screenshot of the WebSocket request from your browsers DevTools?

I would greatly appreciate a repro too, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client cannot connect with https server socket #4198 - GitHub
"Connecting to server" should be logged in the console => Client is able to connect with server socket · "Hi" message should be...
Read more >
Cannot connect Java socket server and client - Stack Overflow
Cannot connect Java socket server and client · Happens with both Java 7 and 8. · Tried several different ports. · No exceptions...
Read more >
Troubleshooting connection issues | Socket.IO
IO client will always try to reconnect, unless specifically told otherwise. Let's review how you can troubleshoot a connection failure.
Read more >
Why TCP socket client can not connect to socket server - MSDN
I am testing a TCP socket app in wifi-environment. 1.) I am using VS2005 to create Console App for Socket-Server (Netframework v2.0)
Read more >
Writing the Server Side of a Socket (The Java™ Tutorials ...
The Java runtime automatically closes the input and output streams, the client socket, and the server socket because they have been created in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found