Open History to see the last commit
1---
2id: debugging
3title: Debugging Solid Usage
4---
5β
6This page covers common Solid and TypeScript problems when using TanStack Form.
7β
8## An input does not start with the expected value
9β
10Every value rendered by an input should exist in form-level `defaultValues`
11when the form is created.
12β
13```tsx
14import { createForm } from '@tanstack/solid-form'
15β
16const form = createForm(() => ({
17 defaultValues: {
18 firstName: '',
19 subscribed: false,
20 },
21}))
22```
23β
24Do not omit `defaultValues` or rely on a field-level default. When values come
25from an API, render a loading state before mounting the editable form or supply
26a complete fallback shape.
27β
28## A field value is `unknown`
29β
30Field names and values are inferred from `defaultValues`. Check that you have
31not widened the initial object to `Record<string, unknown>`, `any`, or an
32unrelated union. Prefer a concrete value type:
33β
34```tsx
35import { createForm } from '@tanstack/solid-form'
36β
37type Profile = { firstName: string; age: number }
38β
39const defaults: Profile = { firstName: '', age: 0 }
40const form = createForm(() => ({ defaultValues: defaults }))
41```
42β
43For extremely large forms, split UI into typed components or scoped form and
44field groups instead of casting each field value.
45β
46## Type instantiation is excessively deep
47β
48This TypeScript error usually involves a very large recursive value shape, a
49widely inferred union, or an unsupported composition. Reduce it to the smallest
50form that reproduces the problem, keep `defaultValues` concrete, and avoid
51unnecessary generic wrappers.
52β
53If the minimal reproduction still fails, report it in the
54[TanStack Form issue tracker](https://github.com/TanStack/form/issues). Include
55the TypeScript and Solid versions, the form value type, and the smallest failing
56field.
57β
58## Errors exist but are not displayed
59β
60`field().errors` respects the form's `errorVisibility` policy. Inspect
61`field().meta.original.errors` when debugging whether validation ran but the
62issues are intentionally hidden. Also confirm that the input calls
63`field().handleBlur` if the policy depends on `isBlurred`.