Generating static pages (2/13) [= ]Static generation failed due to dynamic usage on /dashboard
Unanswered
sa'd posted this in #help-forum
sa'dOP
I'm getting this error whenever I try to build my next app:
This is code for my
I don't know where cookies are being utilised. I'm new to nextjs, so apologies, if this sounds dumb.
Generating static pages (2/13) [= ]Static generation failed due to dynamic usage on /dashboard, reason: cookiesThis 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
@sa'd 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`:
javascript
//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.
sa'dOP
Also, whenever I try to use
export const dynamic = 'force-static' inside the layout.tsx, my routes stop working