[devtools] Preserve full code frames in browser overlay#92621
Merged
aurorascharff merged 8 commits intocanaryfrom Apr 16, 2026
Merged
[devtools] Preserve full code frames in browser overlay#92621aurorascharff merged 8 commits intocanaryfrom
aurorascharff merged 8 commits intocanaryfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make Next.js devtools browser error overlay code frames independent of the dev server terminal width by generating wider server-side frames and allowing horizontal scrolling in the overlay UI.
Changes:
- Pass an explicit large
maxWidthwhen generating code frames on the dev server. - Update overlay code-frame styling to enable horizontal scrolling rather than clipping.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
packages/next/src/next-devtools/server/shared.ts |
Forces a large code-frame maxWidth when rendering original source frames server-side. |
packages/next/src/next-devtools/dev-overlay/components/code-frame/code-frame.tsx |
Attempts to switch overlay code-frame <pre> overflow behavior to horizontal scrolling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Tests Passed |
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
eps1lon
reviewed
Apr 11, 2026
Co-authored-by: Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
devjiwonchoi
approved these changes
Apr 16, 2026
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Problem:
The browser error overlay requests originalCodeFrame from the dev server. That code frame was being generated with process.stdout.columns as the default max width, so if the dev server terminal was narrow the browser overlay received an already-truncated frame with collapsed ellipsis segments.
Fix:
Result:
The overlay no longer changes based on the terminal size running next dev, and long source lines remain inspectable in the browser.
Before:

After:
