How to configure debugging in Visual Studio for React Native?

I searched, but I can’t find any external sources except Visual Studio Code documents, and only after that these documents do not allow debugging React Native applications on both iOS and Android.

I keep getting the error message (this is for Android, for iOS it looks like:

[vscode-react-native] [Warning] Failed to import the script into http: // localhost: 8081 / index.android.bundle? platform = android & dev = true & hot = false & minify = false . Debugging will not work: try restarting JS from the application or Reconnect the VS code debugger: the path should be a string

My launch.json file is like:

 { "version": "0.2.0", "configurations": [ { "name": "Debug Android", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "android", "internalDebuggerPort": 9090, "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }, { "name": "Debug iOS", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "ios", "target": "iPhone 6s", "internalDebuggerPort": 9090, "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }, { "name": "Attach to packager", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "attach", "internalDebuggerPort": 9090, "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }, { "name": "Debug in Exponent", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "exponent", "internalDebuggerPort": 9090, "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" } ] } 

I am trying to debug both an iOS simulator and an Android device, but this process never connects to an external JS debugger.

+6
source share

Source: https://habr.com/ru/post/1013497/


All Articles