Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging with VS Code + Mocha and breakpoint stops at 'read-only inlined content from source map' file

I know, I know.

VS Code version: 1.25.1 Mocha: 4.0.1

Running mocha via launch.json:

{
    "name": "mocha",
    "protocol": "inspector",
    "type": "node",
    "request": "launch",
    "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
    "stopOnEntry": false,
    "args": ["--no-timeouts", "--colors"], //you can specify paths to specific tests here
    "cwd": "${workspaceRoot}",
    "runtimeExecutable": null,
    "env": {
      "NODE_ENV": "testing"
    },
    "sourceMaps": true,
    "outFiles": [
        "${workspaceRoot}/dist"
    ],
  }

and set breakpoint in a file will open another tabbed window of same file with new title "read-only inlined content from source map" and breakpoint may be misaligned. In addition, you try to edit file and you realize you can't.

After flailing at different solutions, dang if setting the sourceMap to false worked for me:

 "sourceMaps": false,

Note: the "outFiles" did nothing, it is an artifact of trying different solutions, including build a map to /dist.

I'm not sure what changed in my configuration/setup. I just upgraded to vscode 1.25, but I don't really know.

This answer is the opposite of Breakpoints and debugging statements open "read-only inlined content"

Good luck!

like image 993
alturium Avatar asked Oct 26 '25 23:10

alturium


1 Answers

Reposting answer from above:

In launch.json:set sourceMaps to false:

"sourceMaps": false,

This answer is the opposite of Breakpoints and debugging statements open "read-only inlined content"

like image 55
alturium Avatar answered Oct 28 '25 15:10

alturium



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!