Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Source maps not working in CommonJS via Hooks API #50839

Closed
@privatenumber

Description

@privatenumber

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp