Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Closed
Description
Version
v21.2.0
Platform
All
Subsystem
All
What steps will reproduce the bug?
Reproduction:https://github.com/privatenumber/bug-node-hooks-cjs-sourcemap
I added a Hook (load
) that just reads the CommonJS file and returns the file as is (thesame example from the docs). When loading a file with an inline source map, the error stack does not show the correct line number. You can see this in the reproduction by runningnpm start
.
In contrast, it works when the same file is directly with--enable-source-maps
without registering a Hook. You can see this in the reproduction by runningnpm run works
.
How often does it reproduce? Is there a required condition?
Every time when CJS is loaded with the Hooks API.
What is the expected behavior? Why is that the expected behavior?
For the source map to work
What do you see instead?
Incorrect error stack line numbers
Additional information
CJS support in Hooks were added in#47999
No response
Metadata
Metadata
Assignees
Labels
No labels