0
votes

I am unable to have my breakpoints hit in my typescript files inside my react-native project. I have looked at various similar questions here at stackoverflow and also on github. (here, here) Here is my tsconfig.json:

{
    "compilerOptions": {
        "target": "es2015",
        "module": "es2015",
        "jsx": "react",
        "outDir": "build",
        "rootDir": "src",
        "allowSyntheticDefaultImports": true,
        "noImplicitAny": true,
        "experimentalDecorators": true,
        "preserveConstEnums": true,
        "allowJs": true,
        "sourceMap": true
    },
    "filesGlob": [
        "typings/index.d.ts",
        "src/**/*.ts",
        "src/**/*.tsx"
    ],
    "exclude": [
        "index.android.js",
        "index.ios.js",
        "build",
        "node_modules"
    ],
    "compileOnSave": false
}

First I build my sources using visual studio code build task (ctrl+shift+B); every thing builds fine and .js files along with corresponding .js.map files are generated inside the ./build folders.

Then I create a launch configuration in the launch.json

From within visual studio code I start the debug process (f5). Every thing works fine and app is loaded and displayed inside my genymotion emulator.

But breakpoints inside typescript are never hit. (They are hit inside the generated .js files though)

I am completely at lost here. No matter what I do I can't get the breakpoints to get hit...

Any help would be greatly appreciated.

1
I've definitely hit issues here recently although with a different stack. Try "inlineSourceMap" instead of "sourceMap" and see if that helps. - Aluan Haddad
thanks for the reply. I tried "inlineSourceMap". Unfortunately breakpoints are still not hit - TheSoul
Have you looked at the source maps the compiler creates? - Aluan Haddad
That is why I have downgraded my react-native cli and my vscode react-native tools to the version it was working...but no result... - TheSoul
I have created a fresh project from the downgraded version. That is waht I am trying now - TheSoul

1 Answers

0
votes

I have applied the suggestion from this github post especially to comment about this PR and now my breakpoints work.