Next.js Discord

Discord Forum

Cache Component in the Root Page

Unanswered
American Shorthair posted this in #help-forum
Open in Discord
American ShorthairOP
I have this on my homepage where I am checking if the user is logged in or not. Based on that I show different UI. But when in the build time, it throws the following error which is random but I know it is related to the code that I just shared.

Error: Route "/_not-found": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience.

I don't want to use Suspance here, because for a millisecond we see white page. It totally works fine in locally. In the previous version of nextjs, we were able to disable the Suspense flag but in v16, I don't think so.

Any workaround?

1 Reply

Transvaal lion
Why do you give the server action the cookies. Ot should be able to get them themselfes. And what is the isAuthentificated declaration.