Sathyakumar Seshachalam
Sathyakumar Seshachalam

Reputation: 2053

Debug a react-native application using nuclide

Is there any good document/video that talks about how to debug a react-native application using Nuclide.

Am a newbie. Its my first time app development and first time with React.

I did create the project using react-native init. I don't think i found a BUCK file for me to run and debug my app. I also don't see to get how to view the errors in my JS file. I have to run the simulator to see. I run it using react-native run-ios.

I tried Nuclide->React Native->Start Debugging. Not sure what this is supposed to do.

Sorry if these questions sound silly.

Upvotes: 3

Views: 2242

Answers (2)

Waqas Ahmed
Waqas Ahmed

Reputation: 1421

Debug JS in Nuclide is now an option in the dev menu added in React Native version 0.52 December 2017 release. See This

Upvotes: 0

Stich
Stich

Reputation: 2381

According to this instruction you should:

  1. From the command Palette (Cmd-Shift-P) choose "Nuclide React Native: Start Packager" to start the React Native Server.

  2. Ensure that you are in the root directory of the React Native project, then run the application from the command-line: "$ react-native run-ios" (or choose other existing simulator, for example react-native run-ios --simulator="iPhone4s").

  3. After starting the server, you can prime the React Native Debugger for when the application begins running. From the command Palette (Cmd-Shift-P), launch "Nuclide React Native: Start Debugging".

  4. From the Simulator press Cmd-D (Ctrl-D on Linux). This will bring up the debug options for your application. Select "Debug JS Remotely.

...After you enable debugging from the simulated application, Nuclide will attach to that debugging process automatically, since we primed the Debugger above.

Upvotes: 1

Related Questions