Skip to content

fix(module-runner): incorrect column with sourcemapInterceptor: "prepareStackTrace"#21562

Merged
sapphi-red merged 2 commits intomainfrom
fix/module-runner-incorrect-col-with-sourcemapinterceptor-prepare-stacktrace
Feb 5, 2026
Merged

fix(module-runner): incorrect column with sourcemapInterceptor: "prepareStackTrace"#21562
sapphi-red merged 2 commits intomainfrom
fix/module-runner-incorrect-col-with-sourcemapinterceptor-prepare-stacktrace

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Feb 5, 2026

The original code for this part is
https://github.com/evanw/node-source-map-support/blob/7b5b81eb14c9ee6c6537398262bf7dab8580621c/source-map-support.js#L386-L395
The code was changed assuming that noHeader.test(globalProcessVersion()) always returns false. But the correct assumption here is that it always returns true.

fixes #21561

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Thanks!

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Feb 5, 2026

Oh, having test would be nice though.

@sapphi-red
Copy link
Member Author

It seems the repro works fine with Vite 8 beta. It has line 4 instead of 1 so the bug doesn't trigger. I'm not sure why but going to merge this PR without a test.

@sapphi-red sapphi-red marked this pull request as ready for review February 5, 2026 07:51
@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: ssr feat: sourcemap Sourcemap support labels Feb 5, 2026
@sapphi-red sapphi-red merged commit 416c095 into main Feb 5, 2026
34 of 35 checks passed
@sapphi-red sapphi-red deleted the fix/module-runner-incorrect-col-with-sourcemapinterceptor-prepare-stacktrace branch February 5, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: sourcemap Sourcemap support feat: ssr p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

module runner stack trace of esm external has wrong column with prepareStackTrace

2 participants