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.

Visual Studio Code debugging

See original GitHub issue

I have an issue with Realm and VSCode debugging, i’m unable to debug because apparently the Realm constructor is missing.

[vscode-react-native] Finished executing: react-native run-ios --simulator iPhone 6s --project-path ios
node --debug-brk=35498 launchReactNative.js 9090 
Debugger listening on [::]:35498
[vscode-react-native] Downloaded debuggerWorker.js (Logic to run the React Native app) from the Packager.
[vscode-react-native] Starting debugger app worker.
[vscode-react-native] Established a connection with the Proxy (Packager) to the React Native application
[vscode-react-native] Debugging session started successfully.
Missing Realm constructor - please ensure RealmReact framework is included!
Module AppRegistry is not a registered callable module.

Then, if I Stop Remote JS Debugging, it works.

However, everything works fine in remote js debugging or not when I use run-android or run-ios instead of VSCode.

So, I guess it’s not an integration issue and something went wrong between Realm and VSCode debugging.

Environment

osx@10.11.6 node@6.2.2 npm@3.9.5 react-native@0.32.0 realm@0.14.3 vscode-react-native@0.1.6 vscode@1.4.0

Related to #374, #562 et #571.

cc @alazier @appden

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MSLaguanacommented, Sep 15, 2016

I believe that the work to support VSCode’s debugger has already been done in the past, the only part that needs to change is the conditional that throws the missing constructor error. Right now it checks for window != null which works in chrome but fails in VSCode. You could modify the check to window != null || __debug__ !== null and that should cause it to work with us.

1reaction
fealebenpaecommented, Sep 6, 2016

Hey @charpeni,

Visual Studio Code uses a worker to execute a React Native app’s JavaScript code inside the editor process when debugging, sort of how like Chrome debugging but unfortunately distinct enough that we’ll need to figure out how we can wire up the Visual Studio Code worker to the Realm binary on the device.

I’m adding this to the backlog so we can get more research done and (hopefully) support VS Code’s sandbox debugger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >
Introduction to Debugging in Visual Studio Code
Debugging is a core feature of Visual Studio Code. In this tutorial, we will show you how to run and debug a program...
Read more >
Debugger Extension - Visual Studio Code
Visual Studio Code's debugging architecture allows extension authors to easily integrate existing debuggers into VS Code, while having a common user interface ...
Read more >
Debug C++ in Visual Studio Code
You can debug Windows applications created using Cygwin or MinGW by using VS Code. To use Cygwin or MinGW debugging features, the debugger...
Read more >
Debug Browser Apps using Visual Studio Code
The simplest way to debug a webpage is through the Debug: Open Link command found in the Command Palette (Ctrl+Shift+P). When you run...
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