-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Bug: Requiring "coffeescript" breaks Node.js built-in source map support globally #5382
Comments
The 1.x line is no longer developed. Does this occur with 2.x? |
Yes, upgraded to 2.6.0, same result. |
I am guessing overriding The following comment also seems inaccurate: coffeescript/src/coffeescript.coffee Lines 365 to 368 in d572d74
...considering that there are now at least 2 standard solutions for source maps in Node.js. |
We could wrap that |
Options can also be passed via the |
Well, you could do How would this not unbreak |
Because that library works via handling |
Personally, I can't see how unconditionally overwriting globals would ever always work nicely with other languages/libraries/features, I think it would be best to refer users to either the Node.js option or the centralized |
The monkey-patch is very old code. Changing it at this point might break other projects that are relying on it. See #4428 for a glimpse of the history. I think scoping the monkey-patch to not happen when Node is run via |
Yeah, though I guess the question is if stack trace breakage would warrant a new major version or not, since it probably does not affect actual functionality in the majority of cases. (also considering that if users already are upgrading, there are better stackmap processing options now that they should also switch to anyway)
Yeah, certainly that is better than nothing. When going down the route of workarounds, another one that could be added is not overriding |
There is a similar but related issue with So if All this may be moot if |
I think Node’s |
Node.js has built in support for source maps via the
--enable-source-maps
command-line option.If any library at any point
require
s "coffeescript", that support gets completely broken (ie. Node.js stack traces stop processing source maps for eg. TypeScript).I am guessing this is due to the entry point in
coffee-script.js
unconditionally overridingError.prepareStackTrace
.Input Code
test.ts
, compiled totest.js
(with sourcemaps).package.json
has"type": "module"
(probably irrelevant).Run with
node --enable-source-maps test.js
.Expected Behavior
Stack trace refers to
test.ts
.Current Behavior
Stack trace refers to
test.js
.Context
One of the libraries I use
require
s "coffeescript" and now all my stack traces are broken.Environment
The text was updated successfully, but these errors were encountered: