-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
String that looks like a source map comment gets used as a source map comment, but only in ESM #51522
Comments
I tried reading through the code, and I think the different behavior is because Node.js uses V8's |
Can this be fixed without adding a full fledge ES parser? IMO the increase in correctness would not be worth the decrease of performance such parser would impose – also I'd expect that no one is affected by this bug, but you never know 😅 |
V8's |
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Fixed in #51690 |
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #51690 Refs: #51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#51690 Refs: nodejs#51522 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Version
21.6.0
Platform
Darwin Nics-MacBook-Air.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112 arm64
Subsystem
No response
What steps will reproduce the bug?
Input code:
Output:
As you can see, the stack trace points to a non-existent
.ts
fileHow often does it reproduce? Is there a required condition?
If you ran that code as CJS rather than ESM, no source map is applied (as expected):
Note that source maps in CJS in general work: you can test by deleting the backtick after
new Error("Hello world!");
(effectively turning the string-that-looks-like-a-comment into an actual source map comments) and you'll see that the source map is appliedAdditional information
Some discussion is happening here: tc39/source-map#64
The text was updated successfully, but these errors were encountered: