---
title: "DF0039: Duplicate JSON-Render View"
description: "A JSON-render view with id \"{id}\" already exists in scope \"{scope}\"."
canonical_url: "https://devfra.me/errors/df0039"
---
# DF0039: Duplicate JSON-Render View

> A JSON-render view with id "\{id}" already exists in scope "\{scope}".

## Message

> A JSON-render view with id "`{id}`" already exists in scope "`{scope}`".

## Cause

An author-supplied id forms each view's shared-state key `devframe:json-render:<scope>:<id>`, so ids must be unique within a scope for the client to keep a stable subscription across reconnects. A second view with the same scoped id throws instead of clobbering the first.

## Example

```ts
createJsonRenderView(ctx, { id: 'metrics', spec })
createJsonRenderView(ctx, { id: 'metrics', spec }) // ✗ throws DF0039
```

## Fix

Give each view a stable id unique within its scope, or dispose the previous view before recreating it. Scope defaults to the context namespace (or `global`); pass `scope` to isolate ids explicitly.

## Source

- [`packages/json-render/src/node/create-view.ts`](https://github.com/devframes/devframe/blob/main/packages/json-render/src/node/create-view.ts): `createJsonRenderView()` throws this when the scoped id is already live.


## Sitemap

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