Next.js Discord

Discord Forum

I want to show the user's email in navbar (app router) DB = Supabase

Answered
Param san posted this in #help-forum
Open in Discord
I am trying to show the user's email in navbar but there might be some problem. I am showing Navbar in root layout.js file. I made two files NavbarServer -> NavbarClient data is passing in that way. Nextjs at build time is showing me this error https://nextjs.org/docs/messages/dynamic-server-error
Answered by fuma
Normally, the cookies function should be called in the same stack as component is rendered. Try opting in dynamic rendering with segment configuration?

export const dynamic = 'force-dynamic'

export default function Layout() ...
View full answer

6 Replies

Can you provide some code? I need more information to determine where is the error occurred
Here you go!
Normally, the cookies function should be called in the same stack as component is rendered. Try opting in dynamic rendering with segment configuration?

export const dynamic = 'force-dynamic'

export default function Layout() ...
Answer
Ohh thanks it worked!
Nice! You can now mark it as the answer :meow_party: