With images
Enzo Ferigolo
||67 visualizações
Why does this solve it?
By adding export const dynamic = 'force-dynamic' in Layout, you ensure that Next.js doesn't try to statically optimize parts of the site that need authentication cookies.
For a personal blog, the performance difference is imperceptible (milliseconds), but it solves all global authentication problems in the Navbar.
Make the change to layout.tsx, restart the server (npm run dev) and the error should disappear.

