When trying to enable Val it fails with:
Error: `draftMode` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context
This seems like a Next.js specific issue. A new Next.js install on 16.2.1 will produce this error, on any route.js file in api like this:
// app/api/foo/route.js
import { draftMode } from "next/headers";
export async function GET() {
const isDraftMode = await draftMode();
return Response.json({ message: "Hello, world!" });
}
When trying to enable Val it fails with:
This seems like a Next.js specific issue. A new Next.js install on 16.2.1 will produce this error, on any route.js file in api like this: