-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Error when using namespace/compound components in React Server Component #75192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@DanielGiljam Thank you for submitting an issue! |
Thank you for the report! To explain why this is the case: when a server component imports a client component, it receives a special client reference that the RSC runtime knows how to send to the browser. In other words, you aren't receiving the underlying export, it's only used to be passed to the client. This is described a bit here: https://react.dev/reference/rsc/use-client:
However, I think the error itself can be improved here. React actually has a special message for this case which should read something like:
We will investigate why it's not being shown in this particular case. |
Link to the code that reproduces this issue
https://github.com/DanielGiljam/nextjs-rsc-jsx-issue
To Reproduce
Start the application in development (next dev)
See the error
Current vs. Expected behavior
Current behavior: you get the error described above.
Expected behavior: namespace/compound components would work like they do in client components.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 Available memory (MB): 32768 Available CPU cores: 10 Binaries: Node: 23.3.0 npm: 10.9.0 Yarn: N/A pnpm: 9.14.2 Relevant Packages: next: 15.2.0-canary.19 // Latest available version is detected (15.2.0-canary.19). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.7.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Module Resolution, Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: