title: How to setup debugging in Visual Studio Code for React Native?
body: <p>I searched but I can't find any external sources except for Visual Studio Code docs, and just following those docs don't allow to debug React Native apps both in iOS or Android.</p>
  
  <p>I keep getting the error message (this one for Android, for iOS is similar:</p>
  
  <blockquote>
    <p>[vscode-react-native] [Warning] Couldn't import script at
    <a href="http://localhost:8081/index.android.bundle?platform=android&amp;dev=true&amp;hot=false&amp;minify=false" rel="noreferrer">http://localhost:8081/index.android.bundle?platform=android&amp;dev=true&amp;hot=false&amp;minify=false</a>.
    Debugging won't work: Try reloading the JS from inside the app, or
    Reconnect the VS Code debugger: path must be a string</p>
  </blockquote>
  
  <p>My <code>launch.json</code> file as:</p>
  
  <pre><code>{
      "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"
          }
      ]
  }
  </code></pre>
  
  <p>I'm trying to debug both in the iOS simulator or in an Android device but the process never attaches to the external JS debugger.</p>