Next.js Discord

Discord Forum

Am I using PPR incorrectly?

Unanswered
Short-eared Owl posted this in #help-forum
Open in Discord
Short-eared OwlOP
I have a component that shows the user profile, using cookies. I've got ppr: true in my next.config. I use unstable_noStore() in my component that calls a function using cookies and I wrap it in Suspense. Before upgrading to the current beta (I was previously in canary.43), everything was fine. I had a logout action that had a redirect() in it. Every time that was used, I was getting a runtime error, saying that a static component tries to access cookies, or used unstable_noStore. So, I removed the redirect. Everything else seems okay again, but when hot module reloading, I often see the same errors, with unstable_noStore being used in a page that is statically rendered, or if I remove unstable_noStore(), it says that I use cookies in a page that is trying to be statically rendered.

Am I missing anything here? Shouldn't I be able to access cookies inside of server components, wrapped in Suspense in PPR?

0 Replies