-
SummaryWhen upgrading to version 16.0.3, I found that pages using drizzle to fetch data in generateStaticParams fail to build successfully, and the following error occurs in dev mode.
The error is within drizzle, located at the following address: The server memory unexpectedly increased threefold, so I want to remove my code: interface BlogDetailPageProps {
params: Promise<{
language: string;
slug: string;
}>;
}
export async function generateStaticParams() {
const blogs = await getBlogSlugAndLanguages();
return blogs;
}
export default async function BlogDetailPage({ params }: BlogDetailPageProps) {
// "use cache";
// cacheLife("weeks");
// cacheTag((await params).slug);
// console.log(
// "!!!!!!! request blog detail page cacheTag:",
// (await params).slug
// );
return (
<Suspense>
<DynamicBlogDetailPage params={params} />
</Suspense>
);
}
// db
export async function getBlogSlugAndLanguages(): Promise<
{ language: string; slug: string }[]
> {
const result = await db
.select({ language: blogs.language, slug: blogs.slug })
.from(blogs)
.where(eq(blogs.published, true))
.groupBy(blogs.language, blogs.slug);
return result;
}Additional informationOperating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 16295
Available CPU cores: 6
Binaries:
Node: 22.13.0
npm: 11.5.2
Yarn: N/A
pnpm: 10.20.0
Relevant Packages:
next: 16.0.3 // Latest available version is detected (16.0.3).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.8.2
Next.js Config:
output: standaloneExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
Disabling cacheComponents in next.config.ts allows the build to complete successfully. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, here you need to:
It is not Suspense itself that defines dynamic behavior, it is your code (some might even say, techincally all code is dynamic), but it is a bit special with so-called non-deterministic operations, you have to align them under either a request time subtree (which itself needs to be Suspense wrapped), or cache them to make them deterministic within their lifetime. Hopefully my PR with docs changes explaining all of this can be merged ASAP. |
Beta Was this translation helpful? Give feedback.

Yeah there's a bunch of places that need some kind of
if cacheComponentsbranching - I am trying to cover those, but in general yeah - generateMetadata is part of the page/layout rendering, so same rules should apply.Please don't forget to mark as answered :)