Fix missing Pages Turbopack runtime in adapter outputs#95708
Open
raidalt wants to merge 1 commit into
Open
Conversation
Contributor
Tests PassedCommit: 0a93e67 |
Contributor
Stats from current PRWarning No stats were collected for Webpack because its stats job did not complete (it failed, was cancelled, or timed out). The results below only cover the bundlers that finished. ✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (2 files)Files with changes:
View diffspages-api-tu..ntime.dev.jsDiff too large to display pages-turbo...ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: 0a93e67 |
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.
What?
Include
pages-turbo.runtime.prod.jsin the shared assets for Node.js Pages Router outputs when building with Turbopack.Add regression coverage confirming that a Pages Router API output contains the runtime in its adapter asset map.
Why?
The Pages Router module wrapper selects this runtime for Node.js production Turbopack builds:
Adapter outputs currently include
pages/module.compiled.jsand its vendored contexts, but they do not explicitly include the Turbopack production runtime required by that module.When a deployment adapter packages a Pages API output independently, the resulting function can therefore contain
module.compiled.jswithout the runtime it requires. The build completes successfully, but the function fails during startup with:This could previously be hidden when Pages API and SSR outputs were packaged together, because another output could incidentally supply the missing runtime.
How?
When collecting shared Node assets:
pagesroute-module type.pages-turbo.runtime.prod.js.The runtime is added to Node.js Pages Router outputs only. App Router, Edge, static, and Webpack outputs are unchanged.
The regression test inspects
outputs.pagesApidirectly so that an SSR output cannot mask the missing API dependency.Testing
The new assertion was verified red-to-green: it failed before the production change because the runtime was absent, then passed after the change.
All passed.
Risk
Low and limited to adapter-generated Node.js Pages Router outputs using Turbopack. The required runtime is approximately 122 KB and asset entries are deduplicated by destination path.
A future improvement could derive the transitive dependency closure automatically or share the runtime path with
module.compiled.js, avoiding duplication of the hard-coded filename.