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

ReferenceError: WebSocket is not defined #16

Closed
sparcs360 opened this issue Sep 20, 2020 · 2 comments · Fixed by #18
Closed

ReferenceError: WebSocket is not defined #16

sparcs360 opened this issue Sep 20, 2020 · 2 comments · Fixed by #18
Labels
good first issue Issue tackles a good aspect released Has been released and published

Comments

@sparcs360
Copy link

I've tried running the "Client usage with Apollo" example from the README.md under Node.

Expected Behaviour

  • it works...

Actual Behaviour

ReferenceError: WebSocket is not defined
    at connect (.../node_modules/graphql-transport-ws/lib/client.js:126:24)
    at .../node_modules/graphql-transport-ws/lib/client.js:220:67
    at Object.createClient (.../node_modules/graphql-transport-ws/lib/client.js:244:11)
    ...

Further Information
subscriptions-transport-ws offers an optional webSocketImpl param on the client constructor (https://github.com/apollographql/subscriptions-transport-ws#constructorurl-options-websocketimpl) - any plans to do something similar?

@enisdenjo enisdenjo added enhancement New feature or request good first issue Issue tackles a good aspect labels Sep 21, 2020
@enisdenjo enisdenjo removed the enhancement New feature or request label Sep 21, 2020
@enisdenjo
Copy link
Owner

Hey @sparcs360, thanks reporting this issue!

Seems like you're trying to use a client in a non-browser environment or the browser is very outdated (doesn't support WebSockets), is this true? I am asking because I want to understand your use-case better.

On the other hand, I've made an issue for supporting custom implementations here: #17.

@enisdenjo
Copy link
Owner

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@enisdenjo enisdenjo added the released Has been released and published label Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue tackles a good aspect released Has been released and published
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants