From 2989f797085fc67745243b5545adaa571d682003 Mon Sep 17 00:00:00 2001 From: conico974 Date: Thu, 20 Nov 2025 09:28:00 +0100 Subject: [PATCH] Add 'use server' directive to markdown renderer (#3815) --- .../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 3d1f69111..56c360b89 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
; },