fix: prerender bailout

This commit is contained in:
iCrawl
2024-05-24 02:10:07 +02:00
parent 7f467ed2d1
commit a35d760421
4 changed files with 38 additions and 49 deletions

View File

@@ -1,4 +1,5 @@
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { DocItem } from '~/components/DocItem';
import { fetchNode } from '~/util/fetchNode';
@@ -25,6 +26,10 @@ export default async function Page({
}) {
const node = await fetchNode({ item: params.item, packageName: params.packageName, version: params.version });
if (!node) {
notFound();
}
return (
<main className="flex w-full flex-col gap-8 pb-12 md:pb-0">
<DocItem node={node} packageName={params.packageName} version={params.version} />