From 660bb3aab62714a33e63748eed4539b8a9017cf4 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sun, 15 Mar 2026 09:17:30 +0300 Subject: [PATCH] Fix shiki shim: export stubs instead of throwing The throwing shim caused hasShikiModule() to return false, but import('shiki') still resolved in some code paths where the module was imported directly without the has-check, causing undefined destructuring and the 'e.find' TypeError. --- src/shims/shiki.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shims/shiki.ts b/src/shims/shiki.ts index 4a9b313e5..f53339244 100644 --- a/src/shims/shiki.ts +++ b/src/shims/shiki.ts @@ -1 +1,5 @@ -throw new Error('shiki is stubbed out to reduce bundle size') +export const bundledThemesInfo: never[] = [] +export const bundledLanguagesInfo: never[] = [] +export function createHighlighter() { + return { getLoadedLanguages: () => [], getLoadedThemes: () => [], codeToTokens: () => ({ tokens: [] }), loadLanguage: async () => {}, loadTheme: async () => {}, dispose: () => {} } +}