Cannot import client components from a non-static dynamic import (This is probably a bug in the React Server Components bundler.) #52873
Labels
bug
Issue was opened via the bug report template.
Lazy Loading
Related to Next.js Lazy Loading (e.g., `next/dynamic` or `React.lazy`).
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #202201071026-Ubuntu SMP Fri Jan 7 16:52:09 UTC 2022 Binaries: Node: 16.20.1 npm: 9.8.0 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 13.4.10 eslint-config-next: 13.4.10 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
Dynamic imports (next/dynamic)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/daneduijnkerke/next-dynamic-import-bug-report
To Reproduce
npx create-next-app@latest test
Page.tsx code:
Components/TestA.tsx (Note this is a CLIENT component)
Components/TestB.tsx (Note this is a SERVER component)
Components/TestC.tsx (Note this is a CLIENT component)
Describe the Bug
When Dynamically importing a client component, using a non-static path, the following error gets thrown:
Error: Could not find the module "/var/www/test/src/app/Components/TestC.tsx#" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
This also happens when you Dynamically import a SERVER component, which (eventually) renders a CLIENT component.
Expected Behavior
To be able to dynamically import CLIENT components, just as SERVER components.
Which browser are you using? (if relevant)
Firefox and Chrome
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: