Skip to content

feat: improve dev error overlay source frames#1746

Merged
james-elicx merged 15 commits into
cloudflare:mainfrom
hyoban:codex/dev-overlay-source-frames
Jun 5, 2026
Merged

feat: improve dev error overlay source frames#1746
james-elicx merged 15 commits into
cloudflare:mainfrom
hyoban:codex/dev-overlay-source-frames

Conversation

@hyoban
Copy link
Copy Markdown
Contributor

@hyoban hyoban commented Jun 5, 2026

Summary

  • map dev overlay stack frames to original source files via the dev server source-map endpoint, including local server/RSC frames
  • show project-relative paths, code frames, and Vite open-in-editor actions in the vinext overlay
  • hide ignore-listed stack frames by default with a toggle to reveal them
  • surface initial dev server errors in the browser overlay by installing it before App Router and Pages Router hydration and replaying serialized server errors
  • disable Vite's built-in HMR overlay so vinext owns the dev error UI
  • add a copy error info action that copies the error type, message, visible stack, code frame, and component stack when available
  • fix App Router dev overlay recovery when server/RSC HMR toggles a throw in a server component or layout, including the document-level __next_error__ recovery path
  • polish overlay layout, light mode, scrollbar styling, transparent backdrop, and width

Tests

  • npx vp check packages/vinext/src/server/dev-error-overlay.tsx packages/vinext/src/server/dev-error-overlay-store.ts packages/vinext/src/server/dev-stack-sourcemap.ts tests/app-browser-entry.test.ts tests/dev-stack-sourcemap.test.ts tests/dev-initial-server-error.test.ts
  • npx vp test run tests/app-browser-entry.test.ts tests/dev-stack-sourcemap.test.ts tests/dev-initial-server-error.test.ts
  • vp run vinext#build
  • PLAYWRIGHT_PROJECT=app-router npx playwright test tests/e2e/app-router/dev-error-overlay.spec.ts -g "HMR updates"
  • PLAYWRIGHT_PROJECT=app-router npx playwright test tests/e2e/app-router/dev-error-overlay.spec.ts
image

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@1746

commit: fcbd449

@hyoban hyoban marked this pull request as ready for review June 5, 2026 04:00
@james-elicx
Copy link
Copy Markdown
Member

/bigbonk review

1 similar comment
@james-elicx
Copy link
Copy Markdown
Member

/bigbonk review

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Jun 5, 2026

@james-elicx Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@james-elicx
Copy link
Copy Markdown
Member

/bigbonk review

@james-elicx
Copy link
Copy Markdown
Member

Ran this through some review passes locally since Bonk can't handle large PRs and nothing major came out, and skimming the diff looks reasonable, so happy to merge it once you're finished.

@hyoban
Copy link
Copy Markdown
Contributor Author

hyoban commented Jun 5, 2026

I have nothing else to change. I've run local tests, and the behavior is acceptable. If any issues arise after the merge, please let me know, and I'll fix them.

@james-elicx james-elicx merged commit fb233b0 into cloudflare:main Jun 5, 2026
28 checks passed
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