Next.js Discord

Discord Forum

Help with Dynamic IO and headers()

Unanswered
Pine Warbler posted this in #help-forum
Open in Discord
Pine WarblerOP
import { auth } from "@/auth";
import { headers } from "next/headers";

export default async function Page() {
  await auth.api.signUpEmail({
    headers: await headers(),
    body: {
      email: "email@gmail.com",
      password: "Password",
      name: "Name",
      role: "admin",
    },
  });
  return <div className="text-red-500">Page</div>;
}

so i created a new next 15 project with dynamic io enabled . im using the better auth library to signUp which requires headers() but i get this error.
A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it.

any idea how to solve it? any help will be appreciated.

0 Replies