-
Notifications
You must be signed in to change notification settings - Fork 223
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
Can't get node-source-map-support to work on node #97
Comments
This project is not broken, I use it regularly! But indeed, the demo is not working as it should… |
Ok if the example is wrong I have created a new example that does work: original.js: require('source-map-support').install();
throw new Error('test'); // This is the original code compiled.js: throw require("source-map-support").install(),new Error("test");
//# sourceMappingURL=compiles.js.map compiled.js.map: {"version":3,"sources":["original.js"],"names":["require","install","Error"],"mappings":"AAEA,KAFAA,SAAQ,sBAAsBC,UAExB,GAAIC,OAAM"} |
Maybe put this in a example dir in the repo? to make it easier for people? |
Ditto. It looks like the culprit for me is the "transform-strict-mode" plugin:
It would be nice to know if this is a bug with |
Re: @CrabDude's "transform-strict-mode" plugin issue: This isn't a problem for me from babel-node 6.24.0 and node 6.10. $ npm i babel-cli babel-plugin-transform-strict-mode source-map-support
$ cat foo.js
require('source-map-support').install();
throw new Error('test'); // This is the original code
$ cat .babelrc
{
"plugins": ["transform-strict-mode"]
}
$ babel-node foo.js
throw new Error('test'); // This is the original code
^
Error: test
at Object.<anonymous> (F:/tmp/@CrabDude/foo.js:2:7)
at Module._compile (module.js:570:32)
at loader (F:\tmp\@CrabDude\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (F:\tmp\@CrabDude\node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Function.Module.runMain (module.js:604:10)
at Object.<anonymous> (F:\tmp\@CrabDude\node_modules\babel-cli\lib\_babel-node.js:154:22)
at Module._compile (module.js:570:32)
$ babel foo.js --out-file compiled-foo.js --source-maps
$ node compiled-foo.js
throw new Error('test'); // This is the original code
^
Error: test
at Object.<anonymous> (F:\tmp\@CrabDude\foo.js:2:7)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3 |
This is fixed now 👏 |
Me (and a colleague) have tried the basic demo from the readme in both node 0.12.7 and 0.10.38, but it doesn't show me the mapped stacktrace. The same occured when I integrated node-source-map-support in my project.
My stacktrace looks like this:
Is this project broken or am I doing something wrong?
The text was updated successfully, but these errors were encountered: