From 8d6178545419b2db5fce9904671254cd88446f2e Mon Sep 17 00:00:00 2001 From: Nicolas Dorseuil Date: Tue, 18 Nov 2025 17:05:24 +0100 Subject: [PATCH] Add 'use server' directive to contentKit markdown renderer --- .../src/components/DocumentView/Integration/contentkit.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/gitbook/src/components/DocumentView/Integration/contentkit.tsx b/packages/gitbook/src/components/DocumentView/Integration/contentkit.tsx index 3d1f691116..56c360b891 100644 --- a/packages/gitbook/src/components/DocumentView/Integration/contentkit.tsx +++ b/packages/gitbook/src/components/DocumentView/Integration/contentkit.tsx @@ -27,7 +27,10 @@ export const contentKitServerContext: ContentKitServerContext = { codeBlock: (props) => { return ; }, + // For some reason, Next thinks that this function is used in a client component + // it's likely an issue with the compiler not being able to track the usage of this function properly markdown: async ({ className, markdown }) => { + 'use server'; const parsed = await parseMarkdown(markdown); return
; },