SSR / foldkit-ssr
When a page is refused
SSR.render fails with ResumeUnsafe before serving a broken page.
reason | Cause | Fix |
|---|---|---|
ViewDependsOnUnsentState | View or meta reads unsent Model field | Add field to state or restored |
LazyDependsOnUnsentState | lazy(model) differs between server and client | Add field lazy reads to state |
UndeclaredStartup | init returned Commands missing from boot | List startup Commands in boot |
Uncovered | Active Surface reads unsent field or sends unlisted Message | Send field (state/restored/local) or list Message |
UnrestorablePart | A plan part failed to restore its capture | Fix the part's capture/restore codec |
DuplicateStaticRegion | Two SSR.static regions share an id | Give each region a unique id |
BindingInStaticRegion | Event handler inside an SSR.static region | Move interactive element into a Surface |
UndeclaredSurfaces | Page has bindings but plan omits surfaces | List active Surfaces in surfaces |
UnencodableBinding | Missing Message Schema or non-constructor Message | Create plan from App; use Message constructors |
EagerStartRequired | Deferred plan starts a Subscription or resource late | Add id to deferrable or set start: 'now' |
VoidRootWithStyles | styles passed for a void HTML root element | Use SSR.generate head or a non-void root |
UnkeepableField | KeepTyped on unsupported element or h builder | Use rh input/textarea/select/checkbox/radio + member |
UnkeptField | Deferred plan input with named handler lacks KeepTyped | Add rh.KeepTyped() or set start: 'now' |
UngeneratablePath | SSR.generate path cannot map to a file | Remove query/fragment; keep paths distinct |
In the browser, SSR.hydrate checks buildId first, then SSR.resume
verifies the envelope (Missing, Duplicate, Unreadable, Protocol,
Plan, Invalid, or Route).
A page the browser does not take over
Pass when(document) and fresh(plan.version) to decline stale or
wrong-viewer pages (such as an author opening a cached visitor page). Add
otherwise: 'render' and until(model) (capped at UNTIL_LIMIT_MS, 3 s) to
keep the served HTML visible while rendering the fresh app off-screen until
until returns true (examples/cms/src/ssr/sitePlan.ts):
ts
SSR.hydrate(config, Post, { buildId, when, otherwise: 'render', until: Site.answered })