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.

Detached from the target, websocket_closed, cannot read property ref of undefined (NM[0] is undefined)

See original GitHub issue

Doing node-debug src/app.js

The immediate feedback from the terminal is :

Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging src/app.js

Debugger listening on [::]:5858

After chrome automatically launches and tries to display the page, the chrome windows show this error message:

“Detached from the target. Remote debugging has been terminated with reason: websocket_closed. Please re-attach to the new target.”

And the console shows this error:

/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:111
      cb(error, NM[0].ref);
                     ^

TypeError: Cannot read property 'ref' of undefined
    at InjectorClient.<anonymous> (/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:111:22)
    at /usr/local/lib/node_modules/node-inspector/lib/DebuggerClient.js:121:7
    at Object.create.processResponse.value (/usr/local/lib/node_modules/node-inspector/lib/callback.js:23:20)
    at Debugger._processResponse (/usr/local/lib/node_modules/node-inspector/lib/debugger.js:95:21)
    at Protocol.execute (_debugger.js:121:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:177:18)
    at Socket.Readable.push (_stream_readable.js:135:10)
    at TCP.onread (net.js:542:20)

I’ve searched everywhere for a solution to this problem and haven’t found one. I hope you can be of assistance!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:121
  • Comments:78

github_iconTop GitHub Comments

31reactions
asi-jmassoncommented, Oct 14, 2016

Same issue with node v6.5.0 can be solved like this :

Edit …\node_modules\node-inspector\lib\InjectorClient.js file at line 111 if(NM.length > 0) cb(error, NM[0].ref);

It works

30reactions
dacuotecuocommented, Oct 21, 2016

my problem can also be solved like this :

Edit …\node_modules\node-inspector\lib\InjectorClient.js file at line 111 if(NM.length > 0) cb(error, NM[0].ref);

It works well!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot debug Nodejs with node-inspector - Websocket_closed
you can see Github issues Detached from the target, websocket_closed, cannot read property ref of undefined (NM[0] is undefined).
Read more >
Remote debugging has been terminated with reason
Detached from target Remote debugging has been terminated with reason: webso... ... TypeError: Cannot read property 'ref' of undefined ...
Read more >
How to Read React Errors (fix 'Cannot read property of ...
Got an error like this in your React component? Cannot read property `map` of undefined. In this post we'll talk about how to...
Read more >
'TypeError: Cannot read property 'components' of ... - TI E2E
TMS320F28379D: 'TypeError: Cannot read property 'components' of undefined' when using .syscfg to add a GPIO target board LAUNCCXL-F28379.
Read more >
Use ES6 Arrow Functions to Resolve "TypeError - Pluralsight
1TypeError : Cannot read property '<your property name>' of undefined. If you run into this error while writing React, the odds are high...
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