---
title: "DF0041: JSON-Render Spec Is Not JSON-Serializable"
description: "JSON-render view \"{id}\" spec is not JSON-serializable: {reason}"
canonical_url: "https://devfra.me/errors/df0041"
---
# DF0041: JSON-Render Spec Is Not JSON-Serializable

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

## 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
const spec: any = { root: 'a', elements: {} }
spec.self = spec // circular reference
createJsonRenderView(ctx, { id: 'x', spec }) // ✗ throws DF0041
```

## Fix

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

## Source

- [`packages/json-render/src/node/create-view.ts`](https://github.com/devframes/devframe/blob/main/packages/json-render/src/node/create-view.ts): `assertJsonSerializable()` throws this at ingress and on `update`.


## Sitemap

See the full [sitemap](https://devfra.me/sitemap.md) for all pages.
