Compound components cause "React.jsx: type is invalid -- expected a string or a class/function" #74585
Closed
Description
Link to the code that reproduces this issue
https://github.com/sebastianvitterso/next-compound-component-issues
To Reproduce
Two "ways to break":
First:
- Start the app using
npm run dev
. - Uncomment
"use client"
incomponents/Compound/index.tsx
. - Broken
Second:
- Start the app using
npm run dev
. - Uncomment EDS'
<Table>
and<Table.Body>
-code inapp/page.tsx
. - Broken
Video showing:
Screen.Recording.2025-01-07.at.13.48.40.mov
Current vs. Expected behavior
For some reason, compound components "randomly" break when used in conjunction with "use client"
-components within server-side pages.
Expectation: No error, just works.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
System Firmware Version: 11881.61.3
Binaries:
Node: 22.11.0
npm: 10.9.0
Relevant Packages:
next: 15.1.1-canary.26
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.2
@equinor/eds-core-react: 0.43.0-dev-01062025
Next.js Config: Default
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response