Skip to content

test: add coverage for ESM external stack trace column numbers with prepareStackTrace#21563

Closed
Copilot wants to merge 4 commits into
fix/module-runner-incorrect-col-with-sourcemapinterceptor-prepare-stacktracefrom
copilot/add-test-for-pull-21562
Closed

test: add coverage for ESM external stack trace column numbers with prepareStackTrace#21563
Copilot wants to merge 4 commits into
fix/module-runner-incorrect-col-with-sourcemapinterceptor-prepare-stacktracefrom
copilot/add-test-for-pull-21562

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 5, 2026

Adds test coverage for PR #21562, which fixes incorrect column numbers in stack traces when using sourcemapInterceptor: 'prepareStackTrace' with ESM external modules.

Changes

  • Test fixture: New ESM external package with single-line code containing padding and nested functions to test column accuracy
  • Test case: Verifies stack trace columns are correct (>60), would fail if 62-char offset incorrectly applied (columns would be ~11 and ~52)
  • Configuration: Added fixture to SSR externals config and .prettierignore to preserve single-line format

The test imports a module that throws through the external:

// esm-external-column-test/index.mjs (single line)
var _padding_______________________; export function outer(fn) { return inner(fn); } function inner(fn) { return fn(); }

// test verifies column numbers in stack:
//   at inner (file://.../index.mjs:1:114)  ✓ correct
//   at outer (file://.../index.mjs:1:73)   ✓ correct
// vs with bug:
//   at inner (file://.../index.mjs:1:52)   ✗ wrong (114-62)
//   at outer (file://.../index.mjs:1:11)   ✗ wrong (73-62)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 5, 2026 04:30
…kTrace

Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot AI changed the title [WIP] Add a test for pull request 21562 test: add coverage for ESM external stack trace column numbers with prepareStackTrace Feb 5, 2026
Copilot AI requested a review from sapphi-red February 5, 2026 04:36
@sapphi-red sapphi-red closed this Feb 5, 2026
@sapphi-red sapphi-red deleted the copilot/add-test-for-pull-21562 branch February 5, 2026 07:47
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