question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get node-source-map-support to work on node

See original GitHub issue

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:

/tmp/smtest/compiled.js:3
throw new Error('test'); // This is the compiled code
      ^
Error: test
    at Object.<anonymous> (/tmp/smtest/compiled.js:3:7)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Is this project broken or am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
0xRcommented, Aug 31, 2015

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"}
1reaction
julien-fcommented, Aug 31, 2015

This project is not broken, I use it regularly!

But indeed, the demo is not working as it should…

Read more comments on GitHub >

github_iconTop Results From Across the Web

source-map-support - npm
This module provides source map support for stack traces in node via the V8 stack trace API. It uses the source-map module to...
Read more >
Is there source map support for typescript in node / nodemon?
run npm install source-map-support --save at the root of your node project and add import 'source-map-support/register' to your main.ts or index.ts file.
Read more >
Error: Cannot resolve module 'module' in [...]source-map ...
I am getting error when running angular 5 application using npm command. ERROR in ./node_modules/source-map-support/source-map-support.js
Read more >
Source maps in Node.js. Supporting the many flavors of…
This special comment indicates that the source map can be found in the file test.js.map , which is in the same folder as...
Read more >
How to use source maps in AWS Lambda with Node.js
Enabling the native source map support for Node 12+. Node.js finally added support for source maps in v12.12.0. Luckily, AWS Lambda runtime for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found