Verify canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000
Binaries:
Node: 16.18.1
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.6-canary.0
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/fikrikarim/nested-next-dynamic-bug
To Reproduce
Create a nested next/dynamic component: import a component with next/dynamic, and inside that component, import another component with next/dynamic.
Run next build and next start. Check the generated HTML.

https://nested-next-dynamic-bug.vercel.app/
Describe the Bug
The recent PR #45160 fix React.lazy preloading during SSR. It's working, but it doesn't preload a nested next/dynamic.
Expected Behavior
The generated HTML should contain the correct content by preloading all next/dynamic, even the nested ones.
Next.js v13.0.6 has the expected behavior:

https://nested-next-dynamic-dbn5z8i2d-fikrikarim.vercel.app/
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/fikrikarim/nested-next-dynamic-bug
To Reproduce
Create a nested
next/dynamiccomponent: import a component withnext/dynamic, and inside that component, import another component withnext/dynamic.Run
next buildandnext start. Check the generated HTML.https://nested-next-dynamic-bug.vercel.app/
Describe the Bug
The recent PR #45160 fix React.lazy preloading during SSR. It's working, but it doesn't preload a nested
next/dynamic.Expected Behavior
The generated HTML should contain the correct content by preloading all
next/dynamic, even the nested ones.Next.js v13.0.6has the expected behavior:https://nested-next-dynamic-dbn5z8i2d-fikrikarim.vercel.app/
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response