Turbopack: include pages/_app next/dynamic imports in each page's loadable 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>
Showing
Please
register
or
sign in
to comment