Skip to content

Comments

fix: incorrect err snippet position in esm files#1192

Merged
KuznetsovRoman merged 3 commits intomasterfrom
INFRADUTY-29746.migrate_sourcemap_lib
Jan 21, 2026
Merged

fix: incorrect err snippet position in esm files#1192
KuznetsovRoman merged 3 commits intomasterfrom
INFRADUTY-29746.migrate_sourcemap_lib

Conversation

@KuznetsovRoman
Copy link
Member

No description provided.

it("should patch webpack protocol sources", () => {
const sourceMap = {
version: 3,
version: 3 as unknown as string,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"js-source-map" has type issues
"version" should definitely be a number

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1192

commit: dba949a

Comment on lines +10 to +13
const hasNoSourceMaps = fileContents.indexOf(JS_SOURCE_MAP_URL_COMMENT) === -1;
const isEsmFile = fileName.startsWith("file://");

if (hasNoSourceMaps && !isEsmFile) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes invalid error snippet position with node22 (when files are imported as esm)
In this case, error stack position are correspond to source code positions already

@KuznetsovRoman KuznetsovRoman merged commit 72ad567 into master Jan 21, 2026
5 checks passed
@KuznetsovRoman KuznetsovRoman deleted the INFRADUTY-29746.migrate_sourcemap_lib branch January 21, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants