Closed hua03 closed 1 year ago
Have you tried to set inlineSourceMap: true
: https://github.com/hua03/swc-node-debug-demo/blob/main/tsconfig.json#L8
If set inlineSourceMap: true
, start the command debug:swc-node
, it will report an error failed to open input source map file
. debug:ts-node
can start the app normally.
@Brooooooklyn I noticed there was a bug where "inline" didn't get passed to swc when inlineSourceMap: true
is set in tsconfig. Submitted a PR with simple fix that seemed to work for me when using @swc-node/register
This is my demo swc-node-debug-demo.
I used two ways to start the debugger, launch and attach. These ways is useless in Webstorm and VSCode.
Test in Webstorm
Start Debugger by launch
repoduce:
debug:swc-node
, Then selectdebug 'debug:swc-node'
http://localhost:3000
on browser.Start Debugger by attach
repoduce:
npm run attach:swc-node
on Terminal, it will print debugger listening addressDebugger attached.
http://localhost:3000
on browser. The debugger do not stop at breakpoints.Test in VSCode
Start Debugger by launch
repoduce:
debug:swc-node
, and run ithttp://localhost:3000
on browser.Start Debugger by attach
repoduce:
npm run attach:swc-node
on Terminal, it will print debugger listening addresshttp://localhost:3000
on browser.