2

I cannot get visual studio code to generate the launchReactNative.js file in the ./vscode folder.

I have been trying to setup a react-native project with typescript with visual studio code and be able to debug typescript files. So far I have been unsuccessful despite looking at various related questions on stackoverflow. None of the suggestions have worked for me. I don't know if the problem has to do with visual studio code itself, react-native-cli, typescript or react-native tools. I am completely at lost here!...

First of all here are the versions of the software I am using:

node: v6.9.4
npm:4.1.2
react-native-cli: 2.0.1
react-native:0.43.3
react native tools:0.3.2

Following the tutorial on the official page, I created a project with the command react-native init my-app

Then I add a tsconfig.json file:

{
    "compilerOptions": {
        "allowJs": true,        
        "target": "es6",                
        "noImplicitAny": false ,
        "rootDir": "./src",
        "outDir": "./dist",
        "jsx": "react",
        "moduleResolution": "node",   
        "noEmitOnError": false,     
        "typeRoots": [
            "./node_modules/@types",            
            "./typings"
        ],
        "sourceMap": true        
    },
    "compileOnSave": true,
    "exclude": [
        "node_modules",
        "__tests__",
        "index.android.js",
        "index.ios.js",
        "dist"
    ]
}

After that I add a launch.js to my project (through the configuration icon button). But I see that launchReactNative.js is never generated. I have uninstalled and reinstalled multiple times react native tools. I have uninstalled and reinstalled multiple times visual studio code. This file is never generated. I remember the last time I created a react-native project with visual studio code (back in december 2016), it was working and I was able to debug my typescript files in the project just fine.

Could it be a known bug in the current version of one of the softwares I mentionned above is stopping the react-native tools to work properly.

Any suggestion would greatly help me. I have spent the last 3 days (my whole week-end) trying to get this setup to work. Please help me, I am at lost here...

TheSoul
  • 4,906
  • 13
  • 44
  • 74

1 Answers1

1

Why is this a problem?

https://github.com/Microsoft/vscode-react-native/issues/99

As for missing launchReactNative.js - that's okay if you're on version 0.3.0 of extension - this file is no more required to start debugger.

Lucero
  • 59,176
  • 9
  • 122
  • 152
  • Thanks for the quick answer. I was thinking that it playing a role in my typescript breakpoints not getting hit – TheSoul Apr 17 '17 at 22:23
  • You may have a look to my question here: http://stackoverflow.com/questions/43442784/vscode-react-native-typescript-breakpoints-ignored-because-surce-code-not-found – TheSoul Apr 17 '17 at 22:24