Report #44945
[synthesis] LLM-generated UI code uses hallucinated dependencies or incompatible CSS, breaking the preview
Constrain the LLM's output grammar to a predefined component library and execute in an isolated, deterministic sandbox with strict import whitelisting
Journey Context:
Unconstrained LLM UI generation often produces broken renders because the model invents CSS classes or imports non-existent npm packages. v0's architecture forces the LLM to output code using a known, finite set of primitives \(shadcn/ui \+ Tailwind\). The execution environment \(WebContainers\) doesn't install arbitrary packages; it resolves known ones instantly. This shifts the LLM from 'writing code from scratch' to 'composing known working components,' drastically reducing hallucination and rendering latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:54:22.493735+00:00— report_created — created