-
Notifications
You must be signed in to change notification settings - Fork 224
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
Invalid line numbers #36
Comments
It seems that this error is due to the header Node prepends in memory to the module: (function (exports, require, module, __filename, __dirname) { This header impacts the column number in the stacktrace which must be corrected before mapping the position. |
@evanw Any updates on this? |
The problem here is that sometimes we want to remove the header and sometimes we want to maintain it. It is unclear when one is preferable. |
pspeter3
added a commit
to pspeter3/node-source-map-support
that referenced
this issue
May 16, 2015
Node adds a header of 62 characters when code is required through a native module. If we are in node, the line number is 1 and the next file is the native 'module.js', we subtract that header. I verified the solution for evanw#36 by reproducing the problem. The stack trace is now: ``` user:node-source-map-support user$ node error.js 1 /Users/user/Documents/node-source-map-support/uglifysanity.js:2 goober(); ^ ReferenceError: goober is not defined at Object.<anonymous> (/Users/user/Documents/node-source-map-support/uglifysanity.js:2:1) ```
Closed
julien-f
added a commit
that referenced
this issue
May 26, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stack traces are producing incorrect line numbers.
Steps to reproduce:
uglifysanity.js:
Then run it through uglify:
Finally, test it in node:
And it produces this output:
Expect this instead:
In Chrome, this seems to work fine. Just not working in Node.js. I'm using
source-map-support@0.2.8
anduglify-js@2.4.15
and Node v0.10.25.The text was updated successfully, but these errors were encountered: