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.

[FATAL] TypeError: Cannot read property 'destroy' of null

See original GitHub issue

Whenever I connect to my server, the console quits and shows this error:

[FATAL] TypeError: Cannot read property 'destroy' of null
    at WebSocket.onClose (/home/pi/Teams/src/GameServer.js:288:23)
    at emitTwo (events.js:111:20)
    at WebSocket.emit (events.js:191:7)
    at WebSocket.emitClose (/home/pi/Teams/node_modules/ws/lib/WebSocket.js:224:10)
    at _receiver.cleanup (/home/pi/Teams/node_modules/ws/lib/WebSocket.js:210:41)
    at Receiver.cleanup (/home/pi/Teams/node_modules/ws/lib/Receiver.js:500:15)
    at WebSocket.finalize (/home/pi/Teams/node_modules/ws/lib/WebSocket.js:210:22)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)

Can anyone help?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Luka967commented, Jan 31, 2017

No worries for thread spam, it’s logs at the most, we accept them.

2reactions
Luka967commented, Jan 31, 2017

In the meantime there’s a simple workaround for this problem; replace the line 288 of GameServer.js with this:

if (ws._socket && ws._socket.destroy != null && typeof ws._socket.destroy == 'function') {
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'destroy' of null #241 - GitHub
Error: I am getting the following error when using ckeditor5-react: vendors~main.chunk.js:91647 Uncaught (in promise) TypeError: Cannot read ...
Read more >
Cannot read property 'destroy' of null - node.js - Stack Overflow
It was such a silly mistake. I changed it in product.ejs file. <input type="hidden" value="<% product.id %>" name="productId">.
Read more >
uncaught typeerror: cannot read properties of null ... - You.com
1 The error says that jsonObject is null. You are testing if data is null. Therefore data must null expressed as JSON so...
Read more >
Cannot read property 'destroy' of undefined - Odoo
Hi friend;. Check your Function Destroy. In fact, it is using a field which is undefined. You can print the field before you...
Read more >
Node.js v19.3.0 Documentation
node:crypto module methods and properties ... The following, for instance, will throw the TypeError because there is no ... ifError(null); // OK assert....
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