You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show dependency frames in prerender diagnostics - #102189
Show third-party dependency call sites in next build --debug-prerender and in the dev overlay's expanded validation-error stacks.
Why?
When a dependency calls new Date() during prerendering, ignore-listing can hide the offending call and leave only the page's component mount site. The suggested debugging commands then fail to identify the dependency. Reproduction.
How?
Reveal dependency frames in debug-prerender output while retaining framework filtering and the React stack cutoff. Preserve dependency frames specifically when serializing validation errors, keeping them collapsed by default in the overlay. Normalize external Webpack frame URLs for display.
Console output
Same command before and after: next build --debug-prerender --webpack.
Before
Error: Route "/external": Next.js encountered the unstable value `new Date()` while prerendering.
at Page (app/external/page.jsx:4:10)
2 |
3 | export default function Page() {
> 4 | return <BlockingWidget />
| ^
5 | }
After
Error: Route "/external": Next.js encountered the unstable value `new Date()` while prerendering.
at readCurrentTime (node_modules/external-time/index.js:2:10)
at BlockingWidget (node_modules/external-time/index.js:6:10)
at Page (app/external/page.jsx:4:10)
2 |
3 | export default function Page() {
> 4 | return <BlockingWidget />
| ^
5 | }
Excerpts from the same fixture on the base commit and PR branch. Paths are normalized relative to the app; the explanatory message and fix suggestions are omitted.
Dev overlay
Both screenshots use Next.js 16.5.0-canary.59 with Webpack and the ignore-listed frames expanded. Before, the dependency call sites are absent. After, the expanded stack includes readCurrentTime and BlockingWidget with their dependency file locations. The collapsed view and the code frame still point at <BlockingWidget /> in the page.
Before
After
Verification
Regression coverage passes in dev and build mode with Turbopack and Webpack, including bundled/external dependencies and in-process/worker validation. All 35 source-map unit cases pass.
Vercel Agent finished reviewing your changes and found no issues. e3bfacb • Mon, 23 Nov 2026 16:09:03 GMT • 1m 21s • Details
Checked (2)
Check
Location
The latest merge preserves the reviewed implementation and regression coverage. Compared the complete previous and current PR diffs with cmp: identical; git diff dab861c HEAD also reports no changes to any PR-touched file.
Validation-worker error delivery retains the development-only filter guard. Traced the NODE_ENV conditional binding to the filterStackFrame option passed into renderToNodeFlightStream.
Vercel Agent Verified Review finished reviewing your changes and approved this pull request. e3bfacb • Mon, 23 Nov 2026 16:15:04 GMT • 7m 16s • Report • Details
Everything checks out under the repository’s review policy.
Summary
Shows third-party dependency stack frames in two places. next build --debug-prerender now prints them, dimmed, via a new __NEXT_SHOW_DEPENDENCY_FRAMES env var. Dev validation errors sent to the browser now keep them, through a new filterStackFrameForErrorDEV Flight filter that also resolves bundled chunks to their original source. Separately, about://React/...file:// frame URLs are now normalized in the webpack dev middleware.
Questions for the author (2)
Next.js's own runtime dependencies that live outside the next/ folder (e.g. styled-jsx, @swc/helpers, server-only, or packages nested under node_modules/next/node_modules/) now count as third-party, so their frames will appear in debug-prerender output and in the expanded overlay stack. Is that intended?
The new fixture sets cacheComponents: true, so both test-infra variants run the same configuration. Is that acceptable given that the fixture depends on Cache Components' sync-IO error?
Checked (5)
Check
Location
Framework packages (next, @next/, react, react-dom, react-server-dom-, scheduler) are never classified as dependency frames, even under pnpm layouts. Read the lastIndexOf('node_modules/') slice and the exclusion regex. Ran pnpm testonly packages/next/src/server/lib/source-maps.test.ts on the head: all 35 cases pass.
Next's precompiled runtime frames stay filtered in the error payload, even after resolving them through the source map. Checked dist/compiled/next-server/app-page{,-turbo}.runtime.dev.js.map in the built head: none of their 388–390 sources contain node_modules/, so findEntry can never classify them as third-party.
Without --debug-prerender, console stack output is unchanged, because the dependency-frame branch only runs when __NEXT_SHOW_DEPENDENCY_FRAMES is 'true'. grep shows the env var is set only in next-build.ts:118 inside if (debugPrerender).
The React bottom-frame cutoff and code-frame choice are unchanged; dependency frames stay marked ignored. Read parseAndSourceMap. The cutoff is still skipped only when showIgnoreListed is set, and sourceFrame selection still requires !ignored.
The new error filter is dev-only and is safe on Edge, where findSourceMap is a no-op. Read the guarded require and the edge noSourceMap fallback at source-maps.ts:9-12.
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
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.
Closed by #102471.
What?
Show third-party dependency call sites in
next build --debug-prerenderand in the dev overlay's expanded validation-error stacks.Why?
When a dependency calls
new Date()during prerendering, ignore-listing can hide the offending call and leave only the page's component mount site. The suggested debugging commands then fail to identify the dependency. Reproduction.How?
Reveal dependency frames in debug-prerender output while retaining framework filtering and the React stack cutoff. Preserve dependency frames specifically when serializing validation errors, keeping them collapsed by default in the overlay. Normalize external Webpack frame URLs for display.
Console output
Same command before and after:
next build --debug-prerender --webpack.Before
After
Excerpts from the same fixture on the base commit and PR branch. Paths are normalized relative to the app; the explanatory message and fix suggestions are omitted.
Dev overlay
Both screenshots use Next.js 16.5.0-canary.59 with Webpack and the ignore-listed frames expanded. Before, the dependency call sites are absent. After, the expanded stack includes
readCurrentTimeandBlockingWidgetwith their dependency file locations. The collapsed view and the code frame still point at<BlockingWidget />in the page.Before
After
Verification
pnpm test-dev-turbo test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.tspnpm test-dev-webpack test/development/app-dir/error-overlay/error-ignored-frames/error-ignored-frames.test.ts