From 1be343d4a539de915fe61b749ff90b53fa2d2765 Mon Sep 17 00:00:00 2001 From: Matteo Celani <26189482+matteocelani@users.noreply.github.com> Date: Wed, 6 May 2026 15:45:30 +0200 Subject: [PATCH] app/ui: fix shiki theme string typescript error --- app/ui/app/src/components/StreamingMarkdownContent.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/ui/app/src/components/StreamingMarkdownContent.tsx b/app/ui/app/src/components/StreamingMarkdownContent.tsx index d41392555..3926d7816 100644 --- a/app/ui/app/src/components/StreamingMarkdownContent.tsx +++ b/app/ui/app/src/components/StreamingMarkdownContent.tsx @@ -2,7 +2,8 @@ import React from "react"; import { Streamdown, defaultRemarkPlugins } from "streamdown"; import remarkCitationParser from "@/utils/remarkCitationParser"; import CopyButton from "./CopyButton"; -import type { BundledLanguage, ThemedToken } from "shiki"; +import type { BundledLanguage } from "shiki"; +import type { ThemeRegistrationAny, ThemedToken } from "@shikijs/types"; import { highlighter, THEME_LIGHT, THEME_DARK } from "@/lib/highlighter"; import { useTheme } from "@/hooks/useTheme"; @@ -63,9 +64,10 @@ const CodeBlock = React.memo( } try { + const shikiTheme = theme === "dark" ? THEME_DARK : THEME_LIGHT; const result = highlighter.codeToTokensBase(codeText, { lang: language as BundledLanguage, - theme: theme === "dark" ? THEME_DARK : THEME_LIGHT, + theme: shikiTheme as ThemeRegistrationAny, }); tokenCacheRef.current[themeKey] = result; return result;