From 5f144ca24d4e12be6edbdae94e06d61bde3d5b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Tue, 17 Mar 2026 04:19:02 +0100 Subject: [PATCH] fix(ui): retry deferred markdown renderer setup --- packages/ui/src/components/markdown.tsx | 5 ++++- packages/ui/src/lib/markdown.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index f0180599..f6fcd091 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -13,7 +13,10 @@ let markdownModulePromise: Promise | null = null function loadMarkdownModule(): Promise { if (!markdownModulePromise) { - markdownModulePromise = import("../lib/markdown") + markdownModulePromise = import("../lib/markdown").catch((error) => { + markdownModulePromise = null + throw error + }) } return markdownModulePromise } diff --git a/packages/ui/src/lib/markdown.ts b/packages/ui/src/lib/markdown.ts index 4d048516..6d041a1f 100644 --- a/packages/ui/src/lib/markdown.ts +++ b/packages/ui/src/lib/markdown.ts @@ -61,7 +61,10 @@ async function getOrCreateHighlighter() { themes: ["github-light", "github-light-high-contrast", "github-dark"], langs: [], }) - })() + })().catch((error) => { + highlighterPromise = null + throw error + }) highlighter = await highlighterPromise highlighterPromise = null