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

Throwing exception on simple use case #905

Open
westhomas opened this Issue Aug 16, 2016 · 62 comments

Comments

Projects
None yet
@westhomas

First time using node-inspector. Here's my setup:

$ nvm --version
0.31.4
$ nvm current
v6.4.0
$ node --version
v6.4.0
$ npm install -g node-inspector

My simple test file:

//test.js
var d = {asdf: 123}
debugger;
console.log(d)

Firing up the debugger throws exception:

$ node-debug test.js
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging `test.js`

Debugger listening on [::]:5858
/Users/wes/.nvm/versions/node/v6.4.0/lib/node_modules/node-inspector/lib/InjectorClient.js:111
      cb(error, NM[0].ref);
                     ^

TypeError: Cannot read property 'ref' of undefined
    at InjectorClient.<anonymous> (/Users/wes/.nvm/versions/node/v6.4.0/lib/node_modules/node-inspector/lib/InjectorClient.js:111:22)
    at /Users/wes/.nvm/versions/node/v6.4.0/lib/node_modules/node-inspector/lib/DebuggerClient.js:121:7
    at Object.create.processResponse.value (/Users/wes/.nvm/versions/node/v6.4.0/lib/node_modules/node-inspector/lib/callback.js:23:20)
    at Debugger._processResponse (/Users/wes/.nvm/versions/node/v6.4.0/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)
@javfindly

This comment has been minimized.

Show comment
Hide comment
@javfindly

javfindly Aug 17, 2016

same issue here, in my case happens when I run Jest:

node-debug node_modules/jest-cli/bin/jest.js -i

Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging node_modules/jest-cli/bin/jest.js

Debugger listening on [::]:5858

/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:112
cb(error, NM[0].ref);
^
TypeError: Cannot read property 'ref' of undefined
at InjectorClient. (/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:112:22)
at /usr/local/lib/node_modules/node-inspector/lib/DebuggerClient.js:121:7

I've already checked, the NM object is an empty array

same issue here, in my case happens when I run Jest:

node-debug node_modules/jest-cli/bin/jest.js -i

Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging node_modules/jest-cli/bin/jest.js

Debugger listening on [::]:5858

/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:112
cb(error, NM[0].ref);
^
TypeError: Cannot read property 'ref' of undefined
at InjectorClient. (/usr/local/lib/node_modules/node-inspector/lib/InjectorClient.js:112:22)
at /usr/local/lib/node_modules/node-inspector/lib/DebuggerClient.js:121:7

I've already checked, the NM object is an empty array

@maherma-adg

This comment has been minimized.

Show comment
Hide comment
@maherma-adg

maherma-adg Aug 17, 2016

I've the same issue, exception are thrown when connecting browser to :8080 port.

I think problem is related to node version, all works with node@6.3.1 and start failing when updated to node@6.4.0

All start working again after rolling back node to 6.3.1

I've the same issue, exception are thrown when connecting browser to :8080 port.

I think problem is related to node version, all works with node@6.3.1 and start failing when updated to node@6.4.0

All start working again after rolling back node to 6.3.1

lynx1983 added a commit to lynx1983/node-inspector that referenced this issue Aug 18, 2016

@pjww

This comment has been minimized.

Show comment
Hide comment
@pjww

pjww Aug 19, 2016

I landed here after spending several hours trying to make things working.

Windows 7, Node 6.4.0 - x64 version.

When, after running node-inspector (or node-debug, or node --debug-brk, etc) I tried to go to the given address (with the GUI debugger with those devtools), the node proccess (and node-inspector proccess, if it was run separately) was crashing. No matter what I tried to do to solve it (downgrading node-inspector included).

In the cmd, the stack trace wasn't really helpful (some exceptions from events.js and something about TCP, sorry, didn't save them). I think they were the same as in javfindly's post.

From the browser, I could only learn that it had something to do with closed websocket and the inspector didn't worked at all (it was empty and console didn't work as well).

After using lynx1983's fix, I also noticed:

"No NativeModule in target scope."

After all, I downgraded Node to 6.3.1 and it's working.

pjww commented Aug 19, 2016

I landed here after spending several hours trying to make things working.

Windows 7, Node 6.4.0 - x64 version.

When, after running node-inspector (or node-debug, or node --debug-brk, etc) I tried to go to the given address (with the GUI debugger with those devtools), the node proccess (and node-inspector proccess, if it was run separately) was crashing. No matter what I tried to do to solve it (downgrading node-inspector included).

In the cmd, the stack trace wasn't really helpful (some exceptions from events.js and something about TCP, sorry, didn't save them). I think they were the same as in javfindly's post.

From the browser, I could only learn that it had something to do with closed websocket and the inspector didn't worked at all (it was empty and console didn't work as well).

After using lynx1983's fix, I also noticed:

"No NativeModule in target scope."

After all, I downgraded Node to 6.3.1 and it's working.

@LeandroFavero

This comment has been minimized.

Show comment
Hide comment

Same problem

@Virtual-Machine

This comment has been minimized.

Show comment
Hide comment
@Virtual-Machine

Virtual-Machine Aug 20, 2016

I also have run into this issue.

code is looking for a property with name == "NativeModule" but on my machine it returns an array of the following properties for refs[result.object.ref].properties

[ { name: 'inspectorConsole', propertyType: 0, ref: 3 },
{ name: 'wrapConsoleCall', propertyType: 0, ref: 3 },
{ name: 'console', propertyType: 0, ref: 3 } ]

The error handling is not working in this area because NM[0] is an invalid reference based on the exclusion of NativeModule in the properties array...

if (!NM.length)
        error = new Error('No NativeModule in target scope');
cb(error, NM[0].ref);

I also have run into this issue.

code is looking for a property with name == "NativeModule" but on my machine it returns an array of the following properties for refs[result.object.ref].properties

[ { name: 'inspectorConsole', propertyType: 0, ref: 3 },
{ name: 'wrapConsoleCall', propertyType: 0, ref: 3 },
{ name: 'console', propertyType: 0, ref: 3 } ]

The error handling is not working in this area because NM[0] is an invalid reference based on the exclusion of NativeModule in the properties array...

if (!NM.length)
        error = new Error('No NativeModule in target scope');
cb(error, NM[0].ref);
@brannon

This comment has been minimized.

Show comment
Hide comment
@brannon

brannon Aug 21, 2016

Not necessarily a good long term fix, but I worked around the problem with the following change to node-inspector/lib/InjectorClient.js:

108       if (!NM.length) {
109         error = new Error('No NativeModule in target scope');
110         return cb(error);
111       }

The debugger loads successfully and I am able to debug my code.

brannon commented Aug 21, 2016

Not necessarily a good long term fix, but I worked around the problem with the following change to node-inspector/lib/InjectorClient.js:

108       if (!NM.length) {
109         error = new Error('No NativeModule in target scope');
110         return cb(error);
111       }

The debugger loads successfully and I am able to debug my code.

@polkovnikov-ph

This comment has been minimized.

Show comment
Hide comment
@polkovnikov-ph

polkovnikov-ph Aug 22, 2016

👍

Downgrade to 6.3.1 helps. This is a regression,

👍

Downgrade to 6.3.1 helps. This is a regression,

@ding444

This comment has been minimized.

Show comment
Hide comment
@ding444

ding444 Aug 24, 2016

For anyone using homebrew and trying to get back to node 6.3.1 after you've already done a cleanup you can re-install 6.3.1 with:

brew install https://github.com/Homebrew/homebrew-core/raw/cc180c23b583487101a1b6697da4126739948dc5/Formula/node.rb

and then switch with:

brew switch node 6.3.1

ding444 commented Aug 24, 2016

For anyone using homebrew and trying to get back to node 6.3.1 after you've already done a cleanup you can re-install 6.3.1 with:

brew install https://github.com/Homebrew/homebrew-core/raw/cc180c23b583487101a1b6697da4126739948dc5/Formula/node.rb

and then switch with:

brew switch node 6.3.1
@thombaynes

This comment has been minimized.

Show comment
Hide comment
@thombaynes

thombaynes Aug 26, 2016

Small addition to the above code - I had to unlink node first, then I could install and switch to 6.3.1.
brew unlink node

Small addition to the above code - I had to unlink node first, then I could install and switch to 6.3.1.
brew unlink node

@ELLIOTTCABLE

This comment has been minimized.

Show comment
Hide comment
@ELLIOTTCABLE

ELLIOTTCABLE Aug 30, 2016

Contributor

Strangely, I see this with Node v6.2.1?

Meanwhile, has anybody tried @lynx1983's patch referenced above?

*Edit: Nope, no such luck. /= I just get the expected “No NativeModule in target scope” instead of an actual crash; but that's not more helpful. Agh!

Well, thank god for nvm: nvm install v6.3.1, problem solved. For now.

Contributor

ELLIOTTCABLE commented Aug 30, 2016

Strangely, I see this with Node v6.2.1?

Meanwhile, has anybody tried @lynx1983's patch referenced above?

*Edit: Nope, no such luck. /= I just get the expected “No NativeModule in target scope” instead of an actual crash; but that's not more helpful. Agh!

Well, thank god for nvm: nvm install v6.3.1, problem solved. For now.

ELLIOTTCABLE added a commit to ELLIOTTCABLE/node-inspector that referenced this issue Aug 30, 2016

@LeandroFavero

This comment has been minimized.

Show comment
Hide comment
@LeandroFavero

LeandroFavero Aug 30, 2016

Same problem in 6.5.0

Same problem in 6.5.0

@FJplant

This comment has been minimized.

Show comment
Hide comment
@FJplant

FJplant Sep 4, 2016

I succeeded with this ticket.

Simply,
yum remove nodejs
yum install nodejs-6.3.1
worked for me. I use OEL 6.7 ( derivation of Redhat Enterprise Linux )

FJplant commented Sep 4, 2016

I succeeded with this ticket.

Simply,
yum remove nodejs
yum install nodejs-6.3.1
worked for me. I use OEL 6.7 ( derivation of Redhat Enterprise Linux )

@aknuds1

This comment has been minimized.

Show comment
Hide comment
@aknuds1

aknuds1 Sep 7, 2016

Also fails for me. Node 6.5.0, Node Inspector v0.12.8 on OS X.

aknuds1 commented Sep 7, 2016

Also fails for me. Node 6.5.0, Node Inspector v0.12.8 on OS X.

@aknuds1

This comment has been minimized.

Show comment
Hide comment
@aknuds1

aknuds1 Sep 7, 2016

Maybe this issue should be split into two, as it addresses two separate bugs? One is the bad handling of the error case, the error being that NativeModule isn't found. PR #914 fixes the first one, so it would definitely help to have an issue dedicated to the second bug.

aknuds1 commented Sep 7, 2016

Maybe this issue should be split into two, as it addresses two separate bugs? One is the bad handling of the error case, the error being that NativeModule isn't found. PR #914 fixes the first one, so it would definitely help to have an issue dedicated to the second bug.

@kmkr

This comment has been minimized.

Show comment
Hide comment
@kmkr

kmkr Sep 7, 2016

Those running 6.5.0 can use native node for the same purposes. It's an experimental feature, but it works fine for me.

node --inspect --debug-brk my-app.js.

Read more here.

kmkr commented Sep 7, 2016

Those running 6.5.0 can use native node for the same purposes. It's an experimental feature, but it works fine for me.

node --inspect --debug-brk my-app.js.

Read more here.

@gae123

This comment has been minimized.

Show comment
Hide comment
@gae123

gae123 Sep 7, 2016

Thanks @kmkr but --inspect appears broken if you use the cluster API to fork workers, beware...

gae123 commented Sep 7, 2016

Thanks @kmkr but --inspect appears broken if you use the cluster API to fork workers, beware...

@wzup

This comment has been minimized.

Show comment
Hide comment
@wzup

wzup Sep 8, 2016

@kmkr

No they can't. node --inspect doesn't work on Windows 64 yet

wzup commented Sep 8, 2016

@kmkr

No they can't. node --inspect doesn't work on Windows 64 yet

@timothyerwin

This comment has been minimized.

Show comment
Hide comment
@timothyerwin

timothyerwin Sep 9, 2016

@wzup solution: stop using windows.

@wzup solution: stop using windows.

@odnarb

This comment has been minimized.

Show comment
Hide comment
@odnarb

odnarb Sep 10, 2016

Same issue.
OS: Ubuntu 15.10

brandon@ubuntu:~$ uname -a
Linux ubuntu 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
brandon@ubuntu:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"
NAME="Ubuntu"
VERSION="15.10 (Wily Werewolf)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.10"
VERSION_ID="15.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Also using node 6.5.0 & npm 3.10.3 with linux brew. My colleague is using Ubuntu as well but nvm with same node/npm releases as mine. Same issue.

The hack @brannon suggested works for me for now.

odnarb commented Sep 10, 2016

Same issue.
OS: Ubuntu 15.10

brandon@ubuntu:~$ uname -a
Linux ubuntu 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
brandon@ubuntu:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"
NAME="Ubuntu"
VERSION="15.10 (Wily Werewolf)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.10"
VERSION_ID="15.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Also using node 6.5.0 & npm 3.10.3 with linux brew. My colleague is using Ubuntu as well but nvm with same node/npm releases as mine. Same issue.

The hack @brannon suggested works for me for now.

@santanu-biswas

This comment has been minimized.

Show comment
Hide comment
@santanu-biswas

santanu-biswas Sep 10, 2016

Same problem with Node 6.5.0 on OSX El Capitan (Ver 10.11.6).
Downgrading to 6.3.1 did not solve the problem!!

Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
/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)

Same problem with Node 6.5.0 on OSX El Capitan (Ver 10.11.6).
Downgrading to 6.3.1 did not solve the problem!!

Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
/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)

dewdad added a commit to dewdad/node-inspector that referenced this issue Sep 11, 2016

@ellerbrock

This comment has been minimized.

Show comment
Hide comment
@ellerbrock

ellerbrock Sep 11, 2016

same problem here with:

Environment Information
========================
npm:         3.10.7
Node:        6.5.0
Electron:    1.3.5

MongoDB shell version: 3.2.8
Date: Mo 12 Sep 2016 03:45:28 ICT

i run node via nvm, with version 4x and 5x its working:

ok        Node v4.5.0
ok        Node v5.12.0
crash     Node v6.5.0

update [17. Sept 2016]

crash     Node v6.6.0

but crashes on current 6x with

▶ node-debug oop.js
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging `oop.js`

Error: listen EADDRINUSE :::5858
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at Agent.Server._listen2 (net.js:1253:14)
    at listen (net.js:1289:10)
    at net.js:1399:9
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

ellerbrock commented Sep 11, 2016

same problem here with:

Environment Information
========================
npm:         3.10.7
Node:        6.5.0
Electron:    1.3.5

MongoDB shell version: 3.2.8
Date: Mo 12 Sep 2016 03:45:28 ICT

i run node via nvm, with version 4x and 5x its working:

ok        Node v4.5.0
ok        Node v5.12.0
crash     Node v6.5.0

update [17. Sept 2016]

crash     Node v6.6.0

but crashes on current 6x with

▶ node-debug oop.js
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.
Debugging `oop.js`

Error: listen EADDRINUSE :::5858
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at Agent.Server._listen2 (net.js:1253:14)
    at listen (net.js:1289:10)
    at net.js:1399:9
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
@bhevesi

This comment has been minimized.

Show comment
Hide comment
@bhevesi

bhevesi Sep 14, 2016

node-inspector is the most popular debug tool for Node. Based on statistic, more than 10k downloads in the last day.
This open critical issue prevents using node v6.5.0 for developers.
I really appreciate Your debug framework and all effort by node-inspector developers but more than 29 days delay to provide solution is not fair. I'm sorry!

bhevesi commented Sep 14, 2016

node-inspector is the most popular debug tool for Node. Based on statistic, more than 10k downloads in the last day.
This open critical issue prevents using node v6.5.0 for developers.
I really appreciate Your debug framework and all effort by node-inspector developers but more than 29 days delay to provide solution is not fair. I'm sorry!

@CarlosLanderas

This comment has been minimized.

Show comment
Hide comment
@CarlosLanderas

CarlosLanderas Sep 15, 2016

Same issue here:

Node version: v6.5.0
Npm version: 3.10.6
Node Inspector v0.12.8

cb(error, NM[0].ref);
^
TypeError: Cannot read property 'ref' of undefined

Same issue here:

Node version: v6.5.0
Npm version: 3.10.6
Node Inspector v0.12.8

cb(error, NM[0].ref);
^
TypeError: Cannot read property 'ref' of undefined

@e-cloud

This comment has been minimized.

Show comment
Hide comment
@e-cloud

e-cloud Sep 18, 2016

This is blocking issue!!! but seems like the team doesn't notice it. @3y3

e-cloud commented Sep 18, 2016

This is blocking issue!!! but seems like the team doesn't notice it. @3y3

@loic294

This comment has been minimized.

Show comment
Hide comment
@loic294

loic294 Sep 18, 2016

Same here Windows x64
Node : 6.6.0

Downgrade is not a solution for me! Hope it's gone be fixed soon...

loic294 commented Sep 18, 2016

Same here Windows x64
Node : 6.6.0

Downgrade is not a solution for me! Hope it's gone be fixed soon...

@tarol

This comment has been minimized.

Show comment
Hide comment
@tarol

tarol Sep 20, 2016

same on win10
node v6.5.0

tarol commented Sep 20, 2016

same on win10
node v6.5.0

@LeandroFavero

This comment has been minimized.

Show comment
Hide comment
@LeandroFavero

LeandroFavero Sep 20, 2016

The lastest release was in April 8. I don't know the future about node-inspector, but I believe that will die. Because NodeJS incorporated the inspector. Try this using 6.6.0:
node --inspect index.js

It's the same, but integrated and faster, really faster!!!

The lastest release was in April 8. I don't know the future about node-inspector, but I believe that will die. Because NodeJS incorporated the inspector. Try this using 6.6.0:
node --inspect index.js

It's the same, but integrated and faster, really faster!!!

@polkovnikov-ph

This comment has been minimized.

Show comment
Hide comment
@polkovnikov-ph

polkovnikov-ph Sep 20, 2016

@LeandroFavero The problem is that hype on Node.js is over, and a lot of temporary solutions became permanent due to the lack of professional developers. Unfortunately --inspect is unstable and doesn't work for most of the interested users. I would expect node-inspector to disappear the same time as node-gyp would get Unicode support and drop Python from dependencies.

For the future commenters: consider using emoji reactions if you have the same setup as previous reporters. There're 2 messages a day with the same content, and it's annoying.

@LeandroFavero The problem is that hype on Node.js is over, and a lot of temporary solutions became permanent due to the lack of professional developers. Unfortunately --inspect is unstable and doesn't work for most of the interested users. I would expect node-inspector to disappear the same time as node-gyp would get Unicode support and drop Python from dependencies.

For the future commenters: consider using emoji reactions if you have the same setup as previous reporters. There're 2 messages a day with the same content, and it's annoying.

@timothyerwin

This comment has been minimized.

Show comment
Hide comment
@timothyerwin

timothyerwin Sep 20, 2016

@polkovnikov-ph why are you saying stuff like that? lack of professional developers? what is that based on? --inspect is new so they still need to patch it up. yes, it sucks that debugging isn't working out right now but they'll get it straightened out. it's unstable because the hype is real.

@polkovnikov-ph why are you saying stuff like that? lack of professional developers? what is that based on? --inspect is new so they still need to patch it up. yes, it sucks that debugging isn't working out right now but they'll get it straightened out. it's unstable because the hype is real.

@fcvidoto

This comment has been minimized.

Show comment
Hide comment
@fcvidoto

fcvidoto Sep 20, 2016

im using windows 10 with node 6.6(before) ..

to solve this I uninstalled node and
downloaded node 4.5 from the official nodejs site

hope this helps someone

im using windows 10 with node 6.6(before) ..

to solve this I uninstalled node and
downloaded node 4.5 from the official nodejs site

hope this helps someone

@bbones

This comment has been minimized.

Show comment
Hide comment
@bbones

bbones Sep 21, 2016

node 6.6.0
mocha 2.5.3
same error...

bbones commented Sep 21, 2016

node 6.6.0
mocha 2.5.3
same error...

@adrian-moisa

This comment has been minimized.

Show comment
Hide comment
@adrian-moisa

adrian-moisa Sep 21, 2016

Same issue
win10
node v6.5.0

Same issue
win10
node v6.5.0

@AndrewMorsillo

This comment has been minimized.

Show comment
Hide comment
@AndrewMorsillo

AndrewMorsillo Sep 22, 2016

I also have the same issue on win10
node v6.6.0

I also have the same issue on win10
node v6.6.0

@vird

This comment has been minimized.

Show comment
Hide comment
@vird

vird Sep 24, 2016

See hack/workaround solution #928 (comment)

vird commented Sep 24, 2016

See hack/workaround solution #928 (comment)

@yinhongyan

This comment has been minimized.

Show comment
Hide comment
@yinhongyan

yinhongyan Sep 24, 2016

Comment out line 111, it works!
image

Comment out line 111, it works!
image

@rolanday

This comment has been minimized.

Show comment
Hide comment
@rolanday

rolanday Oct 3, 2016

Same issue here -- node 6.7.0. Commenting out line 111 gets thinks working again as workaround. Thanks for suggesting!!

rolanday commented Oct 3, 2016

Same issue here -- node 6.7.0. Commenting out line 111 gets thinks working again as workaround. Thanks for suggesting!!

@benduran

This comment has been minimized.

Show comment
Hide comment
@benduran

benduran Oct 4, 2016

Tried upgrading to 6.7.0 in hopes this would be resolved. Still broken. 6.3.1 is the last working version for me on Win 10 Anniversary.

benduran commented Oct 4, 2016

Tried upgrading to 6.7.0 in hopes this would be resolved. Still broken. 6.3.1 is the last working version for me on Win 10 Anniversary.

@WebReflection

This comment has been minimized.

Show comment
Hide comment
@WebReflection

WebReflection Oct 5, 2016

I don't understand why or how downgrading node version could solve the issue because this code is clearly bugged.

Of course if NM.length is 0 any access to its inexistent indexes properties like NM[0].ref would fail.

Accordingly, before even thinking about a possible PR, what should actually happen when NativeModule is not found? A warning? Another attempt? Would passing the error and just null, instead of throwing an error, be appropriate?

WebReflection commented Oct 5, 2016

I don't understand why or how downgrading node version could solve the issue because this code is clearly bugged.

Of course if NM.length is 0 any access to its inexistent indexes properties like NM[0].ref would fail.

Accordingly, before even thinking about a possible PR, what should actually happen when NativeModule is not found? A warning? Another attempt? Would passing the error and just null, instead of throwing an error, be appropriate?

@jeduden

This comment has been minimized.

Show comment
Hide comment
@jeduden

jeduden Oct 6, 2016

Instead of commenting out. Fixed the issue with using:
cb(error, NM[0] && NM[0].ref);

jeduden commented Oct 6, 2016

Instead of commenting out. Fixed the issue with using:
cb(error, NM[0] && NM[0].ref);

@WebReflection

This comment has been minimized.

Show comment
Hide comment
@WebReflection

WebReflection Oct 6, 2016

I've done the same but I don't know side effects, which is why I've asked
what should happen. Also a PR would be better

On Thursday, 6 October 2016, jeduden notifications@github.com wrote:

Instead of commenting out. Fixed the issue with using:
cb(error, NM[0] && NM[0].ref);


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#905 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFO9dj1PcF2i5dZJiOE40vKKE9Aim0kks5qxHh9gaJpZM4Jl714
.

I've done the same but I don't know side effects, which is why I've asked
what should happen. Also a PR would be better

On Thursday, 6 October 2016, jeduden notifications@github.com wrote:

Instead of commenting out. Fixed the issue with using:
cb(error, NM[0] && NM[0].ref);


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#905 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFO9dj1PcF2i5dZJiOE40vKKE9Aim0kks5qxHh9gaJpZM4Jl714
.

@raiteki

This comment has been minimized.

Show comment
Hide comment
@raiteki

raiteki Oct 7, 2016

Broken here too. Node 6.7.0 + MacOS Sierra.

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

TypeError: Cannot read property 'ref' of undefined

raiteki commented Oct 7, 2016

Broken here too. Node 6.7.0 + MacOS Sierra.

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

TypeError: Cannot read property 'ref' of undefined

WebReflection added a commit to WebReflection/node-inspector that referenced this issue Oct 7, 2016

Avoid NodeJS 6.7.0 error
This change fixes #905 + it avoids first argument reassignment.

erikrose added a commit to mozilla/fathom that referenced this issue Oct 10, 2016

Stop using node-inspector, which is broken for recents node versions.
node-inspector/node-inspector#905

This is a real drag, because the node debugger lacks simple affordances like seeing return values.
@MasterJames

This comment has been minimized.

Show comment
Hide comment
@MasterJames

MasterJames Oct 19, 2016

Here is a Pull Request to patch this ASAP
#938

Here is a Pull Request to patch this ASAP
#938

@WebReflection

This comment has been minimized.

Show comment
Hide comment
@WebReflection

WebReflection Oct 19, 2016

I've done a PR too but apparently nobody is maintaining this repo.

On Wednesday, 19 October 2016, Master James notifications@github.com
wrote:

Here is a Pull Request to patch this ASAP
#938 #938


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#905 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFO9cDZ2ALnyMIv0xiOAuugaorqtwvqks5q1X25gaJpZM4Jl714
.

I've done a PR too but apparently nobody is maintaining this repo.

On Wednesday, 19 October 2016, Master James notifications@github.com
wrote:

Here is a Pull Request to patch this ASAP
#938 #938


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#905 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFO9cDZ2ALnyMIv0xiOAuugaorqtwvqks5q1X25gaJpZM4Jl714
.

@hgwood

This comment has been minimized.

Show comment
Hide comment
@hgwood

hgwood Oct 19, 2016

Note that some (all?) node-inspector features are now built into Node: nodejs/node#6792. See the --inspect command-line option.

hgwood commented Oct 19, 2016

Note that some (all?) node-inspector features are now built into Node: nodejs/node#6792. See the --inspect command-line option.

@polkovnikov-ph

This comment has been minimized.

Show comment
Hide comment
@polkovnikov-ph

polkovnikov-ph Oct 19, 2016

@WebReflection It's a bit strange to agree with you, but you're totally correct. It was at least 2 months without a word from a maintainer. The last commit was in April. Looks like native Node's support is anticipated for a long time.

@WebReflection It's a bit strange to agree with you, but you're totally correct. It was at least 2 months without a word from a maintainer. The last commit was in April. Looks like native Node's support is anticipated for a long time.

@MasterJames

This comment has been minimized.

Show comment
Hide comment
@MasterJames

MasterJames Oct 19, 2016

Okay I thought there must be something else people are using now. That makes sense, thanks.
node --inspect your.js
seems to be integrated now.
[note: you'll wanna uninstall node-inspector now then.]

MasterJames commented Oct 19, 2016

Okay I thought there must be something else people are using now. That makes sense, thanks.
node --inspect your.js
seems to be integrated now.
[note: you'll wanna uninstall node-inspector now then.]

@joelkoz

This comment has been minimized.

Show comment
Hide comment
@joelkoz

joelkoz Oct 20, 2016

Also - add the "--debug-brk" option to "--inspect" and the debugger will pause execution until after you connect:

node --inspect --debug-brk your.js

You can then start execution from inside the debugger (after setting any necessary breakpoints).

joelkoz commented Oct 20, 2016

Also - add the "--debug-brk" option to "--inspect" and the debugger will pause execution until after you connect:

node --inspect --debug-brk your.js

You can then start execution from inside the debugger (after setting any necessary breakpoints).

AndreSteenveld added a commit to AndreSteenveld/node-inspector that referenced this issue Oct 31, 2016

@colthreepv

This comment has been minimized.

Show comment
Hide comment
@colthreepv

colthreepv Nov 3, 2016

Using node --inspect is not really a solution for everyone, for instance I am trying to debug an already alive process sending it a USR1 signal to activate debug port

AFAIK this is not supported yet.

Using node --inspect is not really a solution for everyone, for instance I am trying to debug an already alive process sending it a USR1 signal to activate debug port

AFAIK this is not supported yet.

@venkateshilango7 venkateshilango7 referenced this issue Nov 12, 2016

Closed

bug #948

@miroslawmajka

This comment has been minimized.

Show comment
Hide comment
@miroslawmajka

miroslawmajka Nov 17, 2016

Beating the dead horse here but we had to go back to Node v.4.6.1 to get node-inspector working again. This is the setup:

Windows 10
Node v.4.6.1
Npm: 2.15.9
Node Inspector v.0.12.8

This setup works as of today and unless there is an explicit message in the Node or the Inspector changlog one day saying that they fixed this spcific issue we are sticking with this setup. Here's the download link for the old Node if anyone wants it: v.4.6.1.

Beating the dead horse here but we had to go back to Node v.4.6.1 to get node-inspector working again. This is the setup:

Windows 10
Node v.4.6.1
Npm: 2.15.9
Node Inspector v.0.12.8

This setup works as of today and unless there is an explicit message in the Node or the Inspector changlog one day saying that they fixed this spcific issue we are sticking with this setup. Here's the download link for the old Node if anyone wants it: v.4.6.1.

@WebReflection

This comment has been minimized.

Show comment
Hide comment
@WebReflection

WebReflection Nov 17, 2016

@miroslawmajka FYI 6.3.1 should work too. It's the latest version of node 6 that wasn't instantly crashing.

@miroslawmajka FYI 6.3.1 should work too. It's the latest version of node 6 that wasn't instantly crashing.

@leo-lai

This comment has been minimized.

Show comment
Hide comment
@leo-lai

leo-lai Nov 24, 2016

I also have the same issue on win7
node v6.7.0

leo-lai commented Nov 24, 2016

I also have the same issue on win7
node v6.7.0

@hilongjw

This comment has been minimized.

Show comment
Hide comment
@hilongjw

hilongjw Nov 25, 2016

I got seem issue with macOS and Nodejs 6.9.1

/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:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20)

I got seem issue with macOS and Nodejs 6.9.1

/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:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20)
@simonbaker

This comment has been minimized.

Show comment
Hide comment
@simonbaker

simonbaker Nov 29, 2016

me too.
我安装了node 6.3.1版本就好了。。。

me too.
我安装了node 6.3.1版本就好了。。。

gcoombe added a commit to gcoombe/node-inspector that referenced this issue Dec 2, 2016

@Bargamut

This comment has been minimized.

Show comment
Hide comment
@Bargamut

Bargamut Dec 13, 2016

Hi!

It's my first steps in Node.js. =j
I've the same issue:

node --debug server.js
node-inspector

Node 6.9.2
and
Node 7.2.1

On the page:

"Detached from the target by reason: websocket_closed"

In console:

/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:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20)

PS:
node -inspect server.js - success:

node --inspect echoserver.js 
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/10f1f810-c0fb-4ca4-aa31-77b221d326e8

My IDE (PhpStorm + Node.js plugin) runs debug mode like this:

/usr/local/bin/supervisor --debug-brk=47773 --expose_debug_as=v8debug /home/bargamut/projects/testNodejs/server/server.js

It works too.

Bargamut commented Dec 13, 2016

Hi!

It's my first steps in Node.js. =j
I've the same issue:

node --debug server.js
node-inspector

Node 6.9.2
and
Node 7.2.1

On the page:

"Detached from the target by reason: websocket_closed"

In console:

/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:172:18)
    at Socket.Readable.push (_stream_readable.js:130:10)
    at TCP.onread (net.js:542:20)

PS:
node -inspect server.js - success:

node --inspect echoserver.js 
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/10f1f810-c0fb-4ca4-aa31-77b221d326e8

My IDE (PhpStorm + Node.js plugin) runs debug mode like this:

/usr/local/bin/supervisor --debug-brk=47773 --expose_debug_as=v8debug /home/bargamut/projects/testNodejs/server/server.js

It works too.

@maithreya

This comment has been minimized.

Show comment
Hide comment
@maithreya

maithreya Dec 22, 2016

node: v6.9.1
osx: 10.12.2 sierra

screen shot 2016-12-21 at 11 37 06 pm
screen shot 2016-12-21 at 11 37 25 pm

It works for me 💯 . I know this is not a right fix but works temporarily :)

maithreya commented Dec 22, 2016

node: v6.9.1
osx: 10.12.2 sierra

screen shot 2016-12-21 at 11 37 06 pm
screen shot 2016-12-21 at 11 37 25 pm

It works for me 💯 . I know this is not a right fix but works temporarily :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment