Route couldn't be rendered statically because it used `headers`
Unanswered
BakaPresident posted this in #help-forum
I've seen this https://nextjs.org/docs/messages/dynamic-server-error
I think I'm following the correct usage but for some reason i still get the issue. Would the simpler choice be just using
I think I'm following the correct usage but for some reason i still get the issue. Would the simpler choice be just using
force-dynamic
🥹 import { getDrivers } from "@/app/actions/drivers";
import { AddDriverDialog } from "./components/add-driver-dialog";
import { DriversTable } from "./components/drivers-table";
import { Suspense } from "react";
async function getDriversData() {
return getDrivers();
}
export default async function DriversPage() {
const drivers = await getDriversData();
return (
<div className="flex-1 space-y-4 p-8 pt-6">
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Drivers</h2>
<div className="flex items-center space-x-2">
<AddDriverDialog />
</div>
</div>
<Suspense>
<DriversTable drivers={drivers} />
</Suspense>
</div>
);
}