#Partial Prerendering not working with auth?

4 messages · Page 1 of 1 (latest)

lavish kestrel
#

I'm using Next-auth (v5) to get the current session server-side inside the UserMenu.

I've enabled partial prerendering in next.config.js and the log shows that my page should be PPR'ed.

But the page still loads dynamically. Only if I remove the UserMenu does static caching work.

Does PPR currently not work if you access cookies()?

hearty narwhalBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

lavish kestrel
#

Update: It works now after removing a useSession left in a child component. This feels like a bug because useSession (client-side) shouldn't affect static rendering, should it?

upper iris
#

Yes PPR has many bugs at the moment and generally not stable when deploying to vercel. I’d wait for an update or so until it’s more stable