Skip to content

bug: layout.tsx - Error: Unsupported Server Component type: undefined #39

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

Open
Nishchit14 opened this issue Feb 4, 2025 · 2 comments
Open
Labels
3rd party tools Support or bugfixes for 3rd party tools

Comments

@Nishchit14
Copy link

I have some common dialogs which are accessible from anywhere from the app. Thus I need to place them at root layout.tsx. But It is giving this error.

Image

layout.tsx

export default async function Layout({ children }: { children: any }) {
  return (
    <>
      {children}
      <CreateAssistantDialog.Root />
    </>
  )
}
@desko27
Copy link
Owner

desko27 commented Feb 4, 2025

Hi @Nishchit14, thanks for reporting! Clearly this is related to Next.js and RSC.

Someone mentioned this in the past, but the most hassle-free workaround I can think of by now is exporting the Root and the rest separately by means of destructuring:

'use client'

export const { Root, ...Dialog } = createCallable(...)

I tested this and it works, but I'd still like to find a way to keep the original setup as-is. Meanwhile I just added a note in the readme.

@Nishchit14
Copy link
Author

@desko27 Thank you 🙏

@desko27 desko27 added the 3rd party tools Support or bugfixes for 3rd party tools label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party tools Support or bugfixes for 3rd party tools
Projects
None yet
Development

No branches or pull requests

2 participants