-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source maps from packages in node_modules
don't work in the debugger
#45196
Comments
@nodejs/tooling (Maybe there's a better team to ping? I basically looked at the teams that @bcoe is on and picked the one that seemed the most plausibly related to source maps.) |
This might be a good opportunity for a contribution from someone who uses vscode and Node.js, I'm unlikely to have any time to dig into this. |
a workaround is to create a launch config to run your script, specifying the {
"version": "0.2.0",
"configurations": [
{
"name": "Launch TypeScript",
"type": "node",
"request": "launch",
"program": "dist/main.js",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"resolveSourceMapLocations": [
"${workspaceFolder}/dist/**/*",
"${workspaceFolder}/node_modules/**/*"
]
}
]
} however having to create launch configs is inconvenient. i'm not sure anymore whether this a node or vscode issue, so let me know if you think i should raise it there instead. |
Hi @DetachHead, this seems to be an issue with VSCode, not Node. You already provided a fix and it looks like it's working successfully. Moreover, you can find more information about Node.js debugging here. |
raised microsoft/vscode#240356 |
Version
v18.10.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
.ts
file that imports from a package that includes the source code and source maps, for example:tsc main.ts --sourcemap
exactly
function callnode main.js
F11
to step into the functionHow often does it reproduce? Is there a required condition?
every time
What is the expected behavior?
steps into the source code located at
./node_modules/@detachhead/ts-helpers/src/functions/misc.ts
, as the@detachhead/ts-helpers
package includes its source code and source mapsWhat do you see instead?
stepped into compiled

.js
fileAdditional information
debugging in webstorm produces a slightly different result. instead of stepping into the
.js
file when pressing "step into", it just steps over insteadThe text was updated successfully, but these errors were encountered: