fix(devtools-solid): mounting devtools removes the rendered content

Aperta
#376 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@monsterlag ci sta già lavorando.

Dal 21/10/2026.

  • #385 di @xiehuanyi — chiusa senza merge
  • #406 di @monsterlag — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools, frontend

Direzione di ricerca

Start by reproducing the documented sibling mount from packages/devtools-solid/README.md, then inspect ElementRendererContent in packages/solid/src/renderer.tsx and the devtools-solid adapter. Compare the DOM with and without devtools activation using the one-element spec. Done means the rendered text remains visible when JsonRenderDevtools is mounted, with the existing inspection behavior preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Adding the documented drop-in JsonRenderDevtools sibling to a Solid renderer removes the visible content of a one-element spec. The renderer becomes an empty keyed span without a browser exception.

Steps to reproduce

  1. Create a Vite consumer with vite-plugin-solid and install @json-render/[email protected], @json-render/[email protected], @json-render/[email protected], [email protected], and [email protected].
  2. Mount this component in the browser.
import { render } from "solid-js/web";
import { JSONUIProvider, Renderer } from "@json-render/solid";
import { JsonRenderDevtools } from "@json-render/devtools-solid";

const registry = { Text: (ctx) => <p>{ctx.element.props.text}</p> };
const spec = {
  root: "text",
  elements: { text: { type: "Text", props: { text: "Visible renderer" } } },
};
render(() => (
  <JSONUIProvider registry={registry}>
    <Renderer spec={spec} registry={registry} />
    <JsonRenderDevtools spec={spec} />
  </JSONUIProvider>
), document.getElementById("app"));
  1. Inspect the application content after the devtools toggle mounts. Repeat after removing the JsonRenderDevtools sibling.

Expected behavior

Both runs show Visible renderer. Enabling devtools may add inspection attributes or wrappers, but it must preserve the renderer's content. That differential is the closure signal.

Actual behavior

Without devtools, the application contains <p>Visible renderer</p>. With the drop-in devtools component, it contains <span style="display:contents" data-jr-key="text"></span> and no text. Both runs have zero page errors. A third control that calls markDevtoolsActive() before mounting restores the text inside the keyed span.

Affected area

Solid renderer devtools activation and the @json-render/devtools-solid adapter.

Runtime or environment

Reproduced with all json-render packages at 0.21.0, Node v22.23.2, solid-js 1.9.15, vite-plugin-solid 2.11.10, Vite 6.4.3, Playwright 1.58.2, and Chromium 145.0.7632.6. The same differential was previously observed with Vite 7.3.1. Inspected source revision is fc2a696a50a30cb30c878ab1eb65e102487eea0f.

Evidence

The adapter README documents the sibling mount used above. ElementRendererContent places a cached rendered value in the fallback and active wrapper branches of Show. The browser differential isolates the behavior to devtools activation with one renderer component and one spec element.

Impact

The documented devtools integration makes an otherwise working Solid view disappear.

Lingua principale
TypeScript
Stelle
20k
Fork
1.1k
Merge medio
1g 18h
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel-labs/json-render

Tutte le issue di vercel-labs/json-render

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.