VS Code: “Breakpoint ignored because generated code not found” error

前端 未结 18 2600
无人共我
无人共我 2020-12-13 08:07

I have looked everywhere and I still have issue debugging TypeScript inside VS Code. I have read this thread but still I am not able to hit my breakpoints placed inside a Ty

18条回答
  •  抹茶落季
    2020-12-13 08:31

    After a lot of time wasted on resolving this issue, it turned out the best way is to turn on debugging trace by adding the following line in launch.json.

    "trace": true
    

    And see where the problem actually is. Your debug console will output something in the lines of:

    Verbose logs are written to: /Users/whatever/Library/Application Support/Code/logs/blah/blah/debugadapter.txt
    

    Among a lot of other stuff, your console will have lines like these:

    SourceMap: mapping webpack:///./src/index.ts => C:\Some\Path\index.ts, via sourceMapPathOverrides entry - "webpack:///./*": "C:/Some/Path/*"
    

    Use sourceMapPathOverride to fix it to actually match your path. The property "trace" used to be called "diagnosticLogging" which is no longer used.

提交回复
热议问题