facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 682 forks source link

Uncaught TypeError: Cannot read property 'ref' of undefined #673

Closed wuqiuhao closed 6 years ago

wuqiuhao commented 8 years ago

[Enter steps to reproduce below:] I use Atom1.9.9 + nuclide edit React Native. I want to debug in Atom,but show this error.

  1. start React Native Packages
  2. start Debugging
  3. react-native run-ios

Atom Version: 1.9.9 System: Mac OS X 10.11.6 Thrown From: nuclide package, v0.163.0

Stack Trace

Uncaught TypeError: Cannot read property 'ref' of undefined

At /Users/wuqiuhao/.atom/packages/nuclide/pkg/nuclide-debugger-node/VendorLib/node-inspector/lib/InjectorClient.js:111

TypeError: Cannot read property 'ref' of undefined
  at InjectorClient.<anonymous> (/Users/wuqiuhao/.atom/packages/nuclide/pkg/nuclide-debugger-node/VendorLib/node-inspector/lib/InjectorClient.js:111:22)
  at /Users/wuqiuhao/.atom/packages/nuclide/pkg/nuclide-debugger-node/VendorLib/node-inspector/lib/DebuggerClient.js:121:7
  at Object.create.processResponse.value (/Users/wuqiuhao/.atom/packages/nuclide/pkg/nuclide-debugger-node/VendorLib/node-inspector/lib/callback.js:23:20)
  at Debugger._processResponse (/Users/wuqiuhao/.atom/packages/nuclide/pkg/nuclide-debugger-node/VendorLib/node-inspector/lib/debugger.js:95:21)
  at Protocol.execute (_debugger.js:120:14)
  at emitOne (events.js:90:13)
  at Socket.emit (events.js:182:7)
  at readableAddChunk (_stream_readable.js:153:18)
  at Socket.Readable.push (_stream_readable.js:111:10)
  at TCP.onread (net.js:531:20)
msageryd commented 8 years ago

I get the same error in Nuclide. Debugging in Chrome works fine.

tzurae commented 8 years ago

get the same error in Nuclide

wuqiuhao commented 8 years ago

I debugging in Chrome also have some problem!

ghost commented 8 years ago
                                                                                  What the fuck hell is this??                                                                                                                                                                                                                                                                                                                                        Sent from my BlackBerry 10 smartphone.                                                                                                                                                                                                                From: joey3060Sent: Thursday 25 August 2016 11:43 AMTo: facebook/nuclideReply To: facebook/nuclideSubject: Re: [facebook/nuclide] Uncaught TypeError: Cannot read property 'ref' of undefined (#673)get the same error in Nuclide

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/facebook/nuclide","title":"facebook/nuclide","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/facebook/nuclide"}},"updates":{"snippets":[{"icon":"PERSON","message":"@joey3060 in #673: get the same error in Nuclide"}],"action":{"name":"View Issue","url":"https://github.com/facebook/nuclide/issues/673#issuecomment-242290393"}}}

elauqsap commented 8 years ago

Same issue, works great in Chrome but fails w/ Nuclide debugger

mejuneyy commented 8 years ago

get the same error in Nuclide

sxc9870 commented 8 years ago

SAME

amryamanah commented 8 years ago

same i got also this same error.

FredLackeyOfficial commented 8 years ago

This is happening on node v6.5.0. The error went away after rolling back to v4.5.0...

OSX v10.11.6 Chrome Version 52.0.2743.116 (64-bit) node v6.5.0 node-inspector@0.12.8

matthewwithanm commented 8 years ago

Sorry everybody 😞

Looks like this is an issue with node 6. For now, you can just point Nuclide to 5.x by changing the "Path to Node Executable" setting under "React Native" in the Nuclide settings (nuclide-react-native.pathToNode).

kmudrick commented 8 years ago

I got the same error in node-inspector as well

armangithub commented 8 years ago

I got the same error with node-inspector, by now the downgrade of nodejs to v6.3.1 version fix the issue to me.

fbunn commented 8 years ago

CHanging the path to node 5.4.x didn't work for me

IamAlchemist commented 8 years ago

v6.3.1 works for me

msageryd commented 8 years ago

Thanks @IamAlchemist , I'll give it a try. This bug forced me over to React Native Debugger though. It works great.

WasDHL commented 8 years ago

Issue can be fixed by rolling back node to v4.5.0

moon13sun commented 8 years ago

I got the same error in Nuclide

moon13sun commented 8 years ago

This is happening on node v6.5.0. The error went away after rolling back to v4.5.0...

taquiles commented 8 years ago

As per my tests, the error occurs with node version above v6.3.0 on server running nuclide-start-server.

mujuni88 commented 8 years ago

It's happening on node v7.0.0 to.

kvnvelasco commented 8 years ago

Rollback to node 6.1.0 fixes the issue. 6.9.1 LTS caused it for me.

danielcherubini commented 8 years ago

There's a PR open on node-inspector

https://github.com/node-inspector/node-inspector/pull/932

i think nuclide needs to use this to solve the issue

MattHartz commented 7 years ago

Has this been addressed?

hesiming commented 7 years ago

It's happening on node v7.1.0 to.

danielcherubini commented 7 years ago

This should have been addressed in the PR that was just accepted..

The issue was with node-inspector, since that project it looks dead, I took an open PR that fixed the problem and updated that library here.

But my long term suggestion is to re-write this without node-inspector, using the inbuilt node debugger instead

matthewwithanm commented 7 years ago

We're actually going to be switching to using JSC instead of node soon. That way it'll be more like the actual environment.

vinceyuan commented 7 years ago

This error disappears on Node v6.3.1, but breakpoint on atom/nuclide does not work. Breakpoint works on node4-lts or 4.6.2. If you want to use atom/nuclide to debug react-native project, you have to use node4-lts or 4.6.2.

littlegoofey commented 7 years ago

can work around it by changing line 111 of /xxxx/xxxx/xxxx/node-inspector/lib/InjectorClient.js:111 from

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

  if (NM.length > 0)
  cb(error, NM[0].ref);
vinceyuan commented 7 years ago

@littlegoofey Thanks for your solution. I think we can change line 111 of ~/.atom/packages/nuclide/pkg/nuclide-debugger-node-rpc/VendorLib/node-inspector/lib/InjectorClient.js to cb(error, NM.length==0 ? null : NM[0].ref);

I can debug React-Native project with Atom/nuclide now. Can't believe it's been broken for so long time.

mostafaeweda commented 6 years ago

We're included a better RN and Node debugger integration in Nuclide, so, these issues are fixed.