Static fallbacks
Non-executing render targets must not boot the VM. Use the HTML export and fallback options when output is a string, ANSI text, PDF, or email — not an interactive page.
Use the HTML renderer export
Import ArrowSandbox from comark-arrow/html for static pipelines:
import arrow from 'comark-arrow'
import { ArrowSandbox } from 'comark-arrow/html'
// createHtmlRenderer({ plugins: [arrow()], components: { ArrowSandbox } })
The Vue component at comark-arrow/vue mounts the sandbox only in onMounted. SSR and Nuxt therefore skip VM boot during server render.
Choose a fallback mode
Control what non-interactive targets show via fence attribute or plugin option:
| Value | Output |
|---|---|
caption | Default — short label or summary |
source | Raw fence source as text |
placeholder | Empty or minimal block |
arrow({ fallback: 'source' })
```arrow {fallback="placeholder"}
// widget source — not executed in PDF/email pipeline
```
Pre-bundle TypeScript in Vite hosts
@arrow-js/sandbox does import ts from 'typescript'. Vite must pre-bundle TypeScript so the default export resolves correctly:
export default defineNuxtConfig({
vite: {
optimizeDeps: {
include: ['typescript', '@arrow-js/sandbox', 'quickjs-emscripten'],
},
},
})
The same optimizeDeps.include array belongs in plain vite.config.ts for non-Nuxt Vite apps. Without it, dev-server lazy loading of the sandbox can fail when TypeScript is not pre-optimized.