VSCode react-native typescript: breakpoints ignored because source code not found

青春壹個敷衍的年華 提交于 2019-12-25 09:26:40

问题


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 have applied the suggestion from this github post especially to comment about this PR and now my breakpoints work.



来源:https://stackoverflow.com/questions/43442784/vscode-react-native-typescript-breakpoints-ignored-because-source-code-not-foun

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!