Reference
Errors
Every error has a stable code and type. art check prints it for people; art check --ai prints one JSON line with expected, actual and fixes, ready to send back to a model.
$ art check --ai
{"code":"E1011","type":"UNKNOWN_FIELD","loc":"app.art:13:10","at":"Users","expr":"u.emial","expected":"id|name|email","fixes":["email"]}| Code | Type | Meaning |
|---|---|---|
| E0001 | UNEXPECTED_CHAR | Invalid character in the source. |
| E0002 | UNTERMINATED_STRING | Unterminated string. |
| E0003 | UNEXPECTED_TOKEN | Unexpected token; something else was expected. |
| E1001 | UNDEFINED_NAME | Name not defined in this scope. |
| E1002 | DUPLICATE_NAME | Name declared twice. |
| E1003 | UNKNOWN_TYPE | Unknown type. |
| E1010 | TYPE_MISMATCH | The value's type doesn't match the expected one. |
| E1011 | UNKNOWN_FIELD | The model has no such field. |
| E1012 | MISSING_FIELD | A required model field is missing. |
| E1023 | POSSIBLY_EMPTY | The value may be null; that case must be handled. |
| E1024 | NOT_A_LIST | `for` needs a list. |
| E1030 | ASSIGN_READONLY | Only `state` and `let` variables can be assigned. |
| E1040 | AUTH_REQUIRED | `login` and `private` need an `auth` declaration. |
| E1050 | UNKNOWN_MODULE | The module of a `use` can't be found (not installed, or a wrong path). |
| E1051 | UNKNOWN_EXPORT | The module doesn't export that name. |
| E1060 | TEXT_BRACES | `{name}` inside a plain string isn't interpolated; use a template `${name}`. |
| E2001 | UNKNOWN_ELEMENT | Unknown UI element or component. |
| E2002 | UNKNOWN_PROP | Invalid prop for this element or component. |
| E2003 | MISSING_PROP | A required prop is missing (component props, or `options` of select/radio/tabs). |
| E2004 | NO_ACTION | This element doesn't take an `->` action. |
| E2005 | STATEMENT_IN_VIEW | A statement where an element goes; statements belong in an action, a fn, `mount` or `effect`. |
| E2005 | NO_CONTENT | This element doesn't take content. |
| E2006 | NOT_BINDABLE | `input`, `select`, `checkbox`, `modal`, etc. need a `state` (or a field of one) to bind to. |
| E2007 | NO_CHILDREN | This element doesn't take `{ }` children. |
| E2008 | LAYOUT_SLOT | A layout needs exactly one `slot`, and `slot` only goes in layouts. |
| E2009 | BAD_ROUTE | Invalid or repeated page route. |
| E2010 | BAD_CLEANUP | `cleanup { }` only goes inside `mount { }` or `effect { }`. |
| E2011 | LAYOUT_CYCLE | A layout ends up inside itself through `layout` (Docs inside Site inside Docs). |
| E3001 | PATCH_SYNTAX | Invalid patch line: an operation was expected. |
| E3002 | TARGET_NOT_FOUND | The patch path doesn't exist. |
| E3003 | AMBIGUOUS_TARGET | The path matches several nodes: add an index `[n]`. |
| E3004 | PATCH_BODY | The patch body isn't valid for that target. |