diff --git a/bun.lockb b/bun.lockb index a7eb63d86..4d73d9611 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index f903dd436..f2ba9c5cc 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,7 @@ "server-only": "^0.0.1", "shikiji": "^0.8.0", "tailwind-merge": "^1.14.0", - "tailwind-shades": "^1.1.2", - "vscode-oniguruma": "^2.0.1" + "tailwind-shades": "^1.1.2" }, "devDependencies": { "@cloudflare/next-on-pages": "^1.7.3", diff --git a/src/components/DocumentView/CodeBlock/highlight.ts b/src/components/DocumentView/CodeBlock/highlight.ts index b1551050f..e02f385b4 100644 --- a/src/components/DocumentView/CodeBlock/highlight.ts +++ b/src/components/DocumentView/CodeBlock/highlight.ts @@ -1,7 +1,7 @@ import { DocumentBlockCode, DocumentBlockCodeLine, DocumentInlineAnnotation } from '@gitbook/api'; import { getHighlighter, loadWasm, bundledLanguages, Highlighter, ThemedToken } from 'shikiji'; // @ts-ignore - onigWasm is a Wasm module -import onigWasm from 'vscode-oniguruma/release/onig.wasm?module'; +import onigWasm from 'shikiji/onig.wasm?module'; import { getNodeText } from '@/lib/document'; @@ -301,7 +301,7 @@ async function loadHighlighter() { // loads it on its own. // // Otherwise for Vercel/Cloudflare, we need to load it ourselves. - await loadWasm(onigWasm); + await loadWasm(obj => WebAssembly.instantiate(onigWasm, obj)) } const instance = await getHighlighter(); await instance.loadTheme('css-variables');