Skip to content

Compound components are throwing Error: Element type is invalid in next 15.5.5 #84961

@IshfaqAhmedProg

Description

@IshfaqAhmedProg

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/zpk3k2

To Reproduce

  1. Start the application in development mode

Current vs. Expected behavior

Current Behaviour

Next js throws this error

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Expected Behaviour

Next js should render the compound component

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
  Available memory (MB): 12157
  Available CPU cores: 4
Binaries:
  Node: 20.18.0
  npm: 10.9.1
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  next: 15.5.5 // Latest available version is detected (15.5.5).
  eslint-config-next: 15.5.4
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

I reproduced this issue in codesandbox and local setup, console logging results in this

page.tsx (Home)

console.log("Tab:", Tabs.Tab);  // undefined

Tabs.tsx

console.log("Tab:", Tabs.Tab);  // Tab: [Function: Tab]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions