Turbopack: include pages/_app next/dynamic imports in each page's loadable manifest by andrewimm · Pull Request #98292 · vercel/next.js · GitHub
Skip to content

Turbopack: include pages/_app next/dynamic imports in each page's loadable manifest - #98292

Open
andrewimm wants to merge 1 commit into
canaryfrom
codex/turbopack-pages-app-dynamic-ids
Open

Turbopack: include pages/_app next/dynamic imports in each page's loadable manifest#98292
andrewimm wants to merge 1 commit into
canaryfrom
codex/turbopack-pages-app-dynamic-ids

Conversation

@andrewimm

Copy link
Copy Markdown
Contributor

Turbopack emits a react-loadable manifest per page, built from the dynamic imports reachable from that page's client entry. pages/_app is a separate endpoint, so a next/dynamic({ ssr: true }) declared there ended up only in server/pages/_app/react-loadable-manifest.json, which is never read when rendering a page. Its module id was therefore missing from __NEXT_DATA__.dynamicIds.

The client did not wait for the chunk before hydrating, it rendered the loadable's fallback, and React discarded the server-rendered markup. Webpack is unaffected by this because its manifest is global.

Solution is to merge the /_app endpoint's dynamic import entries into every page endpoint's manifest, keeping each endpoint's own chunking availability info so no additional chunks are emitted.

Fixes #98287

…dable manifest

Turbopack emits a react-loadable manifest per page, built from the dynamic
imports reachable from that page's client entry. `pages/_app` is a separate
endpoint, so a `next/dynamic({ ssr: true })` declared there ended up only in
`server/pages/_app/react-loadable-manifest.json`, which is never read when
rendering a page. Its module id was therefore missing from
`__NEXT_DATA__.dynamicIds`, the client did not wait for the chunk before
hydrating, rendered the loadable's fallback and React discarded the
server-rendered markup. Webpack was unaffected because its manifest is global.

Merge the `/_app` endpoint's dynamic import entries into every page endpoint's
manifest, keeping each endpoint's own chunking availability info so no
additional chunks are emitted.

Fixes #98287

Co-authored-by: Andrew Imm <494043+andrewimm@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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.

Turbopack build omits __NEXT_DATA__.dynamicIds for next/dynamic({ ssr: true }) declared in pages/_app — server HTML discarded on hydration

1 participant