Next.js Discord

Discord Forum

Generating static pages (2/13) [= ]Static generation failed due to dynamic usage on /dashboard

Unanswered
sa'd posted this in #help-forum
Open in Discord
I'm getting this error whenever I try to build my next app:

Generating static pages (2/13) [= ]Static generation failed due to dynamic usage on /dashboard, reason: cookies

This is code for my page.tsx inside the /dashboard:

//import SignOutBtn from "@/components/auth/SignOutBtn";
//import { getUserAuth } from "@/lib/auth/utils";

export default async function Home() {
  //const { session } = await getUserAuth();
  return (
    <main className="">
      <h1 className="text-2xl font-bold my-2">Profile</h1>
      <pre className="bg-secondary p-4 rounded-lg my-2">
        {/*JSON.stringify(session, null, 2)*/}
      </pre>
      {/*<SignOutBtn />*/}
    </main>
  );
}


I don't know where cookies are being utilised. I'm new to nextjs, so apologies, if this sounds dumb.

1 Reply