node-inspector: Undefined `ref` property

node-inspector version: 0.12.8 node version: 6.9.1 OS: Windows 10 x64

See code at https://github.com/node-inspector/node-inspector/blob/master/lib/InjectorClient.js#L108-L111

if (!NM.length)
   error = new Error('No NativeModule in target scope');

cb(error, NM[0].ref);

if NM.length is zero, NM[0] is undefined and node-inspector crashes with TypeError: Cannot read property 'ref' of undefined.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 23
  • Comments: 16

Most upvoted comments

I also get this error:

  • node-inspector version: 0.12.8
  • node version: 6.9.3
  • OS: mac os x 10.12.2

See code at https://github.com/node-inspector/node-inspector/blob/master/lib/InjectorClient.js#L108-L111

if (!NM.length)
   error = new Error('No NativeModule in target scope');

cb(error, NM[0].ref);

temporary change :

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

cb(error, NM[0].ref);

same problem here on windows 10