Error Unsupported Server Component type undefined

Hey, I'm playing around with Next 13 rn and I encountered an issues. I have my root layout.tsx Which only has the default stuff in it + my Navbar Component The page.tsx uses a server side component to fetch data from my database and display it. My navbar component however I want to be a client side component, once i add "use client"; to the file i get the error: Error: Unsupported Server Component type: undefined In my server console it tells me to check the line where I use the Navbar component in the layout. Has anyone faced a similar project or this how its supposed to work?
3 Replies
NotLuksus
NotLuksus2y ago
Adding "use client"; to the layout.tsx did the trick However it feels like that is not the intended way of doing it, since rn, i put "use client" basically in every file except the once I use the use hook Which seems like quite a bad experience Also hot reload is incredibly slow when i have a server side component rendered
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
NotLuksus
NotLuksus2y ago
In my case I used my own components library which where all exported from an index.ts file in that directory and i imported from there After adding the "use client"; there aswell it worked