Help With: is missing "generateStaticParams()
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
Trying to get fumadocs to install with the output of export however I keep running into a wall, not to sure how else to debug this since, the method is 100% there.
app/docs/[[...slug]]/page.tsx
app/docs/[[...slug]]/page.tsx
import { source } from '@/lib/source';
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import { getMDXComponents } from '@/mdx-components';
export default async function Page(props: { // Revert back to async/props pattern
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params; // Revert back to async/props pattern
const page = source.getPage(params.slug);
if (!page) notFound();
const MDX = page.data.body;
return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={getMDXComponents()} />
</DocsBody>
</DocsPage>
);
}
export async function generateStaticParams() {
return source.generateParams();
}
export async function generateMetadata(props: { // Revert back to async/props pattern
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params; // Revert back to async/props pattern
const page = source.getPage(params.slug);
if (!page) notFound();
return {
title: page.data.title,
description: page.data.description,
};
}
npm run build
> app-zenmod-nextjs@0.1.0 build
> next build && node ./scripts/update-index.mjs
▲ Next.js 14.2.28
- Environments: .env
- Experiments (use with caution):
· turbo
· forceSwcTransforms
Creating an optimized production build ...
[MDX] update map file: 17.098ms
✓ Compiled successfully
✓ Linting and checking validity of types
> Build error occurred
Error: Page "/docs/[[...slug]]" is missing "generateStaticParams()" so it cannot be used with "output: export" config.