Skip to content

DF0041: JSON-Render Spec Is Not JSON-Serializable

Message

JSON-render view "{id}" spec is not JSON-serializable: {reason}

Cause

Specs and state travel across the RPC / static boundary as strict JSON. A spec containing functions, symbols, class instances, Map/Set, or circular references cannot cross that boundary, so it is rejected at ingress.

Example

ts
// ✗ Bad — circular reference
const spec: any = { root: 'a', elements: {} }
spec.self = spec
createJsonRenderView(ctx, { id: 'x', spec }) // DF0041

// ✓ Good — plain JSON data
createJsonRenderView(ctx, { id: 'x', spec: { root: 'a', elements: { a: { type: 'Text', props: { text: 'hi' }, children: [] } } } })

Fix

Keep specs and state strict JSON — remove functions, symbols, class instances, Map/Set, or circular references.

Source

Released under the MIT License.