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.
This commit is contained in:
Danila Poyarkov 2026-03-15 09:17:30 +03:00 committed by Anton A S
parent 1a86f3fa16
commit 660bb3aab6

View file

@ -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: () => {} }
}