Skip to content
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

initApollo.js: WebSocket is closed before the connection is established. #383

Closed
3 tasks done
quano1 opened this issue Jul 25, 2021 · 1 comment
Closed
3 tasks done

Comments

@quano1
Copy link

quano1 commented Jul 25, 2021

Prerequisites

  • Are you running the latest version?
  • Are you able to consistently reproduce the issue?
  • Did you search the issue queue for existing issue? Search issues

Issue Description

After login as admin. Constantly get this message on admin page: 'WebSocket connection to 'ws://localhost:3000/graphql' failed: WebSocket is closed before the connection is established.'

Steps to Reproduce

Please provide starting context, i.e. logged in as a user, configure a particular payment method.

  1. start all containers
  2. login admin
  3. refresh the page
  4. Observe the issue

Possible Solution

A solution from: hasura/graphql-engine#4509 (comment)

initApollo.js

new WebSocketLink({
      uri: graphQlApiUrlWebSocket,
      options: {
        reconnect: true, // auto-reconnect
        lazy: true, // <--- THIS LINE
        connectionParams: {
          authToken: localStorage.getItem("Meteor.loginToken")
        }
      }
    }),

Versions

3.11.1

@j2l
Copy link

j2l commented Mar 29, 2022

Even after fixing initApollo.js I get an empty profile for the admin user.
In console:
WebSocket connection to 'ws://localhost:3000/graphql' failed: WebSocket is closed before the connection is established.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants