From fde32e26bf10cd32af783fb97dbbd483a84bfca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Fri, 10 Jan 2025 16:26:25 +0100 Subject: [PATCH] Force route handler to be dynamic to avoid errors (#2721) --- .changeset/shiny-cheetahs-grow.md | 5 +++++ .../src/app/(site)/(content)/[[...pathname]]/page.tsx | 1 + packages/gitbook/src/app/(site)/(content)/layout.tsx | 1 + packages/gitbook/src/app/(space)/~gitbook/pdf/page.tsx | 1 + 4 files changed, 8 insertions(+) create mode 100644 .changeset/shiny-cheetahs-grow.md diff --git a/.changeset/shiny-cheetahs-grow.md b/.changeset/shiny-cheetahs-grow.md new file mode 100644 index 000000000..b7275da04 --- /dev/null +++ b/.changeset/shiny-cheetahs-grow.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Force route handler to be dynamic to avoid errors diff --git a/packages/gitbook/src/app/(site)/(content)/[[...pathname]]/page.tsx b/packages/gitbook/src/app/(site)/(content)/[[...pathname]]/page.tsx index d40e82444..a9f5a279a 100644 --- a/packages/gitbook/src/app/(site)/(content)/[[...pathname]]/page.tsx +++ b/packages/gitbook/src/app/(site)/(content)/[[...pathname]]/page.tsx @@ -17,6 +17,7 @@ import { PageClientLayout } from './PageClientLayout'; import { PagePathParams, fetchPageData, getPathnameParam, normalizePathname } from '../../fetch'; export const runtime = 'edge'; +export const dynamic = 'force-dynamic'; type Props = { params: Promise; diff --git a/packages/gitbook/src/app/(site)/(content)/layout.tsx b/packages/gitbook/src/app/(site)/(content)/layout.tsx index 6e628b95a..cd7132fc3 100644 --- a/packages/gitbook/src/app/(site)/(content)/layout.tsx +++ b/packages/gitbook/src/app/(site)/(content)/layout.tsx @@ -23,6 +23,7 @@ import { RocketLoaderDetector } from './RocketLoaderDetector'; import { fetchContentData } from '../fetch'; export const runtime = 'edge'; +export const dynamic = 'force-dynamic'; /** * Layout when rendering the content. diff --git a/packages/gitbook/src/app/(space)/~gitbook/pdf/page.tsx b/packages/gitbook/src/app/(space)/~gitbook/pdf/page.tsx index 1c72c072a..ec9328490 100644 --- a/packages/gitbook/src/app/(space)/~gitbook/pdf/page.tsx +++ b/packages/gitbook/src/app/(space)/~gitbook/pdf/page.tsx @@ -39,6 +39,7 @@ import { PrintButton } from './PrintButton'; const DEFAULT_LIMIT = 100; export const runtime = 'edge'; +export const dynamic = 'force-dynamic'; export async function generateMetadata(): Promise { const ctx = getGitBookContextFromHeaders(await headers());