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.

BUG: TypeError: protocols.has is not a function (5.6.1 version)

See original GitHub issue

I got this bug on new version

image

handleProtocol?? [ 'graphql-transport-ws' ] graphql-transport-ws
/batcave/node_modules/graphql-ws/lib/server.js:280
        : protocols.has(common_1.GRAPHQL_TRANSPORT_WS_PROTOCOL))
                    ^
TypeError: protocols.has is not a function
    at Object.handleProtocols (/batcave/node_modules/graphql-ws/lib/server.js:280:21)
    at WebSocketServer.completeUpgrade (/batcave/node_modules/ws/lib/websocket-server.js:323:33)
    at WebSocketServer.handleUpgrade (/batcave/node_modules/ws/lib/websocket-server.js:271:10)
    at Server.<anonymous> (/batcave/node_modules/postgraphile/build/postgraphile/http/subscriptions.js:369:21)
    at Server.emit (node:events:520:28)
    at onParserExecuteCommon (node:_http_server:727:14)
    at onParserExecute (node:_http_server:641:3)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hiepxanhcommented, Feb 24, 2022

ya, look like that is the root cause of this issue. Thank you for your quick fix, very nice ❤️

0reactions
enisdenjocommented, Feb 23, 2022

Seems like the protocols argument in WebSocketServer.handleProtocols was an Array in v7 (also stated in the breaking changes of v8), the fix in v5.6.2 covers the issue.

Additionally, I’ve made sure that all future tests run on ws@7 too so bugs like these won’t creep up.

Thanks for reporting!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: domain.enter is not a function - Stack Overflow
I found out what was the problem, it turns out that I was overriding request.domain during one of my middlewares.
Read more >
Bug listing with status RESOLVED with resolution TEST ...
Bug :233 - "Emacs segfaults when merged through the sandbox." status:RESOLVED resolution:TEST-REQUEST severity:critical · Bug:3888 - "yenta_socket module not ...
Read more >
How to Build a Full Stack NFT Marketplace - V2 (2022)
I am getting this Error after createItem function (on click Create an Asset button). I have same RPC in Metamask and the JSONRpc....
Read more >
draft-ietf-rtcweb-security-arch-09
The protocol to be used between the domains is not standardized by WebRTC, ... Simpler versions with lower levels of security are also...
Read more >
PyCryptodome Documentation - Read the Docs
Why does strxor raise TypeError: argument 2 must be bytes, not ... The following packages, modules and functions have been removed:.
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