Skip to content

Troubleshooting

Read the signal inside the binding using p(title) or p(() => title.value). A call such as p(title.value) captures a setup-time snapshot. When the signal stores an array, assign a new array to track a structural edit. See signals.

A reactive element requires an active scope

Section titled “A reactive element requires an active scope”

Put reactive element construction inside the factory passed to mount:

const title = signal("Hello");
const dispose = mount(root, () => p(title));

Create conditional content and list rows inside their factories so the correct owner can clean them up. See rendering and lifetime.

Check the value returned by the key callback for every record. Each active record needs its own stable ID. Copy the ID when replacing a record that represents the same item. See lists and keys.

Serve ESM over HTTP and keep the shared chunks beside the entry points under dist/. Use the classic IIFE script for a page opened from disk. If a TypeScript app uses package imports, install the tarball first and preserve the /html or /svg subpath. See quick start.

Review the signals read and written by the same effect. Move derived work into a pure computed. Use untracked for incidental reads and return cleanup for work that has to be stopped before the next run. See the reactivity API.

A form displays a different value from the model

Section titled “A form displays a different value from the model”

Use the element argument to read value or checked in the native handler. Bind that value to the matching signal, and use defaultValue or defaultChecked for browser-managed fields. See events and forms.