Reference
Error handling
How comark-vega handles invalid specs without breaking the rest of the document.
Invalid specs produce a fallback node instead of throwing, so the rest of the document still renders.
Fallback node
<pre class="vega vega-error vega-{tag}">…error message…</pre>
The {tag} segment matches the directive or component name (for example vega, vl, chart-bar).
Vue component behaviour
The shipped <Vega> component shows a <pre class="vega-error"> message for invalid specs. It does not throw during render.
Console warning
A console.warn is emitted with the error details. Use it during development to fix spec JSON or binding expressions.
What still renders
- Other markdown blocks on the same page
- Other charts with valid specs
- Text and components before and after the failed chart
Validate specs in your editor or CI when you need hard failures. The plugin chooses soft failure so one bad chart does not break an entire report or docs page.
See Component props for the props the renderer expects.