Skip to content

perf(dev): cache sourcemap consumer per bundle in error handler - #4786

Merged
pi0 merged 2 commits into
v2from
backport/dev-sourcemap-cache
Oct 15, 2026
Merged

pi0 merged 2 commits into
v2from
backport/dev-sourcemap-cache

Conversation

@pi0x

@pi0x pi0x commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Backports #4454 (#4454) to v2. The dev error handler built a new SourceMapConsumer for every app stack frame, so the bundle's .map was parsed again for each frame of each error. Consumers are now cached per bundle file for the duration of one loadStackTrace pass and destroyed afterwards, and a map that fails to parse falls back to the original frame instead of throwing. Unlike main, v2 keeps the static source-map import and node:path, and this adds a unit test (test/unit/dev-error-sourcemap.test.ts) since the main PR had none.

🤖 Generated with AI assistant

@pi0x
pi0x requested a review from pi0 as a code owner October 15, 2026 08:09
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nitro.build Ready Ready Preview Oct 15, 2026 8:18am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3727be1-9d58-4103-8bed-73213da3ea88

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitropack@4786

commit: c6cf6b5

@pi0
pi0 merged commit 158be6d into v2 Oct 15, 2026
11 of 12 checks passed
@pi0
pi0 deleted the backport/dev-sourcemap-cache branch October 15, 2026 08:44

This branch was successfully deployed

1 active deployment
Preview — c6cf6b53 Deployed Oct 15, 2026 by vercel[bot]
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