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

TypeError: Cannot set property 'readyState' of undefined resurfaced? #1704

Closed
mo22 opened this issue Mar 4, 2020 · 3 comments
Closed

TypeError: Cannot set property 'readyState' of undefined resurfaced? #1704

mo22 opened this issue Mar 4, 2020 · 3 comments

Comments

@mo22
Copy link

mo22 commented Mar 4, 2020

Hi, in the current version (7.2.1) an older bug similar to #1564 seems to have reappeared:

node_modules/ws/lib/websocket.js:837
websocket.readyState = WebSocket.CLOSING;
TypeError: Cannot set property 'readyState' of undefined
   at Socket.socketOnClose (node_modules/ws/lib/websocket.js:837:24)
   at Socket.emit (events.js:333:22)
    at Socket.EventEmitter.emit (domain.js:485:12)
@lpinca
Copy link
Member

lpinca commented Mar 4, 2020

The issue was caused by an invalid usage of ws, so my guess is that you are doing the same mistake. Are you using gun.js? If so see #1606 and #1606 (comment) in particular.

Please fill the issue template, it's there for a reason, and create a test case to reproduce the issue.

@mo22
Copy link
Author

mo22 commented Mar 5, 2020

Yup, you're right. I do not use gun.js, but there were two WebSocket servers created for the same http server.
Maybe ws can check if there is already an instance attached to a http server?
Closing this as it is not a bug.

@mo22 mo22 closed this as completed Mar 5, 2020
@lpinca
Copy link
Member

lpinca commented Mar 5, 2020

It should, see 3641266. I'm not sure why it is not detected in your case.

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

2 participants