{{ message }}
Turbopack: include pages/_app next/dynamic imports in each page's loadable manifest - #98292
Open
andrewimm wants to merge 1 commit into
Open
Turbopack: include pages/_app next/dynamic imports in each page's loadable manifest#98292andrewimm wants to merge 1 commit into
andrewimm wants to merge 1 commit into
Conversation
…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>
Contributor
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.

Turbopack emits a react-loadable manifest per page, built from the dynamic imports reachable from that page's client entry.
pages/_appis a separate endpoint, so anext/dynamic({ ssr: true })declared there ended up only inserver/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
/_appendpoint'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