evanw / node-source-map-support

Adds source map support to node.js (for stack traces)
MIT License
2.16k stars 222 forks source link

Error still show compiled code #312

Closed AaroncoolPx closed 2 years ago

AaroncoolPx commented 2 years ago

I did the basic setup of original.js, compiled.js and compiled.js.map.

Later tried running the following: node -r source-map-support/register compiled.js

I got the following: compiled.js:3 throw new Error('test'); // This is the compiled code ^ Error: test at Object.<anonymous> (compiled.js:3:7) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

It suppose to show the error happening at original.js

Nodejs version: v16.13.1