-
Notifications
You must be signed in to change notification settings - Fork 38.9k
vscode node debugger parses inline sourcemap incorrectly #35978
Copy link
Copy link
Closed
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityRequest for new features or functionalityverifiedVerification succeededVerification succeeded
Milestone
Description
- VSCode Version: 1.17.0
- OS Version: macOS 10.13
Steps to Reproduce:
- Create an empty folder
- Add
package.jsonwith the following content:
{
"name": "vscode-issue",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@std/esm": "^0.11.3"
},
"@std/esm": {
"esm": "all",
"cjs": true
}
}
- Create file
index.jswith the following content:
import path from "path";
console.log(path.resolve(__dirname, ".."));
- Configure launch.json as:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/index.js",
"runtimeArgs": [
"-r","@std/esm"
]
}
]
}
npm install- Press F5 to start vscode debugger
- You will see the following error:
Debugging with inspector protocol because Node.js v8.6.0 was detected.
node --inspect-brk=36570 -r @std/esm index.js
Debugger listening on ws://127.0.0.1:36570/a572c7ff-3251-4ae3-b74c-5abe01c3b73c
Debugger attached.
SourceMaps.getMapForGeneratedPath: exception while processing path: /Users/user/Development/vscode-issue/index.js, sourcemap: data:application/json;charset=utf-8,%7B%22version%22:3,%22sources%22:%5B%22/Users/user/Development/vscode-issue/index.js%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AAAA;AACA;AACA%22%7D
SyntaxError: Unexpected token � in JSON at position 0
at JSON.parse (<anonymous>)
at new SourceMap (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.node-debug2/node_modules/vscode-chrome-debug-core/out/src/sourceMaps/sourceMap.js:20:25)
at sourceMapContentsP.then.contents (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.node-debug2/node_modules/vscode-chrome-debug-core/out/src/sourceMaps/sourceMapFactory.js:53:28)
at <anonymous>
Reproduces without extensions: Yes
It seems vscode debugger always assumes the inline sourcemap data URI is in base64 encoding (even if the ;base64 extension is not included in the data URI scheme).
This will lead to data decoding error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
debugDebug viewlet, configurations, breakpoints, adapter issuesDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionalityRequest for new features or functionalityverifiedVerification succeededVerification succeeded