Diagnostic codes
Every diagnostic code Tuimark reports, grouped by the pass that finds it.
Every problem Tuimark finds is a diagnostic with a stable code. The letter names the pass (V parse, L layout, B bind), and the dump lists each one under errors with its severity, code, message, and source position. A dump with any error-severity diagnostic has "ok": false, and the CLI exits 2. Link to a code with its anchor, like /reference/diagnostics#v003.
Parse (V…)
Reported while reading the .tui document and its stylesheets. Most are errors: the dump is not ok.
| Code | When |
|---|---|
V001 | unknown tag; a version="2" tag in a version="1" document (message ends with (requires version="2")); input, button, list, modal, table, tabs, or tab inside a container each template; checkbox, select, textarea, template, or use in a document that writes version, with (requires a <tui> without version), and nothing further checked or expanded on it; in a <tui> without version, a checkbox or select inside a list <item> or a container each template, at any depth (then no V012 or V017), <radio>, with the hint a radio group is a <list> with checked= and single="true", and <option>, with the hint use <select each=… key=… label=…> (a document that writes version keeps the old radio and option hints); <fragment> anywhere but the root of an included file; a <template> that is not a direct child of <tui> or <screen> in the expanded document (it is not collected); a tui, app, fragment, screen, style, keymap, bind, or template inside a <template>, at any depth, instead of the placement message (the element is dropped from the body); a <use> directly in a <keymap>; in a <tui> without version, a <slot/> outside every template's body (<slot/> is only valid inside a <template>: it marks where the content of a <use> goes) and, judged where it stands in the body of the template that holds it, never where a copy lands, a <slot/> that an <include> brings into the content of a <use>, one inside a list <item>, and one in a container each template or directly in a <table> or a <list each=…>, each then receiving nothing; <slot> in a document that writes version, tag <slot> (requires a <tui> without version); a tui, app, fragment, screen, style, keymap, bind, or template in the content of a <use> outside a template's body, at any depth (<NAME> cannot be inside a <use>: its content fills a <slot/>, which holds content only), dropped from the fill; a written <span>, unknown tag <span>; spans are generated from <text runs="…"> in a <tui> without version, while a document that writes version keeps unknown tag <span>; use <text>; a <textarea> in a list <item> or a container each template, at any depth, with an input's message there and <textarea> for <input>, and then no V012 (a <tui> without version) |
V002 | unknown attribute; a version="2" attribute in a version="1" document (with the same hint); focusable, on:click, or on:focus inside a container each template; a version="3" attribute (stick on scroll, focus on modal, when on keymap, priority on column, scale on sparkline) in a version="1" or version="2" document, with (requires version="3") (on a 0.2b tag in a version="1" document only that tag's V001 is reported); stick inside a list <item> or a container each template (version="3"); indeterminate on progress in a document that writes version, with (requires a <tui> without version), and indeterminate on any other tag, as an attribute it does not take; single on list or table in a document that writes version, with (requires a <tui> without version) (in a version="1" document a table reports only its own V001); on:click on a checkbox or a select; any attribute on the root of an included <fragment> (version included); on a <use>, any attribute but id, template, with, if, hidden, and class (class:NAME, disabled, style, sizes, events), with the hint that a use is not a node, except, in a <tui> without version, a name that could be a prop name: on a <use> whose template names a template, such an attribute that the template does not declare in props, checked as written, once per written use, with no suffix, whether or not the use expands, with the hint to declare it in the template's props; on a <template>, any attribute but id and, in a <tui> without version, props; any attribute on a <slot/>; runs on a text in a document that writes version, attribute "runs" on <text> (requires a <tui> without version); secret on a textarea, attribute "secret" is not allowed on <textarea>, and any other attribute outside its row of the attribute table (a <tui> without version) |
V003 | bad unit / color / token / CSS property; a version other than 1, 2, or 3; a version="2" value, property, pseudo-class, media feature, or built-in action in a version="1" document (with the hint); switch-to without to; a hyphenated built-in in an on:* attribute; a tab without a non-empty label; {path} in label, short, mark, or keycap; a sparkline without bind; a bad scope, min, or max; in a version="1" or version="2" document, with (requires version="3"): {path} in a tab's label or short, row-gap/column-gap, or the wrap values truncate-start/truncate-middle (an invalid wrap value lists the two only in a version="3" document); stick other than bottom, or stick on a scroll with axis="x"; a bad selector in a <keymap>'s when, once, at the <keymap>; a priority that is not a non-negative integer; a scale that is not a plain identifier (version="3"); in a <tui> without version, a <bind> whose keys holds ctrl+i, ctrl+j, or ctrl+m, once per token, at the <bind>, with no hint (a document that writes version accepts them); {path} in a button's label or body in a document that writes version, once per attribute or body, at the label attribute or at the <button>, with the message {path} in a <button> label (requires a <tui> without version); in a <tui> without version, a {…} pair in them that does not hold exactly a path; an indeterminate that is not true or false, or indeterminate="true" together with bind or value (the progress is then a bar); a single other than true or false (the attribute is then ignored); a type selector naming checkbox or select, in a stylesheet or a when, in a document that writes version, with (requires a <tui> without version); a {…} pair in a checkbox's label that does not hold exactly a path; in a <tui> without version, a type selector naming include, fragment, template, use, or slot, in a stylesheet or a when (<use> is not a node and never matches); in a <tui> without version, props: in a template's props, a separator other than one space, then, in the order of the names, an invalid name, a name declared twice, or id, template, with, if, hidden, or class; in a template's body, a malformed {$…}, a {$name} the template does not declare, a {$name} inside a pair of braces, and a {$name} where a prop cannot stand (a path, an id, template, src, …: the attribute is then ignored, but counts as written), each once, with no suffix, whether the template is used or not; a {$name} outside a template's body (the <template>'s own id and props included), instead of any other diagnostic about that value (a <style> or <include> src then loads nothing, and a <use>'s prop is not passed); a brace pair that a prop's value forms in a copy, at the <use> attribute where the brace is written (prop "NAME" makes the pair "PAIR"), every prop that brings a brace into that value then not passed in the copy; a bad substituted value, at the template's attribute or text, with the placement suffix of the <use> that wrote the bad text; a runs that is not a path, runs="V" is not a path, and, in a template's body, a {$name} in it, {$NAME} cannot stand in runs: a prop is text; pass a path with with="…"; in a document that writes version, pre-wrap as a wrap value, wrap: value "pre-wrap" (want W) (requires a <tui> without version), and a type selector naming span, selector "S": type "span" (requires a <tui> without version) |
V004 | duplicate id, over the expanded document with the ids of <use> and <template> elements (one that an <include> or a <use> placed twice is reported at the innermost include or use that placed the second; the copies of two uses with the same id are not compared); any id inside a container each template (version="2"), a <use>'s included; the ids of a fill, which the use that receives it does not scope: a fill counts as placed where it is written, never by the use whose slot receives it (a <tui> without version) |
V005 | not well-formed XML; or not a Tuimark document: a root element other than <tui> (or the phase-0 alias <app>), or a <tui> with no <screen>; a file whose root is <fragment> given as a document, except to validate and fmt |
V006 | style src include cycle; an <include src> that is an include cycle, is outside the file system (LoadFS), or cannot be read; one in the content of a <use> resolves its src against the file where the content is written, its cycles checked on the includes of that place, and is read by the definition of the template whose body holds it, whether or not a copy places it, and, outside every template's body, only when the content fills a slot |
V007 | control character or ANSI in text (strip + error) |
V008 | native widget name not registered (v1.1+) |
V010 | dock and fr on the same axis |
V011 | each / if missing path; an each alias equal to an enclosing one (version="2"); a malformed each on a select, or an alias of it equal to an enclosing one (a <tui> without version); a malformed with on a <use> (clauses path as alias separated by exactly ", "), an alias written twice in one with, or a with alias equal to an alias in scope where the use stands, and the use inserts nothing; an each alias inside a copy equal to a with alias in scope there, at that element, and the copy is still inserted (a <tui> without version); an each alias in a fill is compared only with the aliases in scope where the fill is written |
V012 | list/input/button/modal without id; a table, tabs, or tab without id (version="2"); a scroll with stick and no id (version="3"); a checkbox, select, or textarea without id (<textarea> is focusable and needs an id), a <template> without id, and a <use> without id whose template holds an id at any depth (the content of the uses written in its body included, the use's own fill not), except in a container each template, which then inserts nothing (a <tui> without version) |
V013 | <text> has element children; character data directly in a <template>, and content in a <use> whose template names no <slot/>, at its first element or text, checked as written, once per written use (<template id="T"> has no <slot/>), and text directly in a <use> whose template's slot can receive it (text is not allowed directly inside <use>; wrap it in <text>), neither of the two in a fragment checked on its own toward a template whose body holds an <include>; content in a <slot/> (<slot/> takes no content: the content of the <use> fills it); content in an <include> (<include> takes no content; to wrap content, make the fragment's markup a <template> with a <slot/> and place it with <use>) (a <tui> without version); character data other than whitespace in the body of a <text runs>, <text runs> takes no body text: its text comes from the runs, the body being ignored (a <tui> without version); an element child of a textarea, <textarea> cannot contain elements (found <U>), and character data in it, text is not allowed directly inside <textarea>; its text is the value at its bind path (a <tui> without version) |
V014 | retired: never reported since 0.4.1, when version became optional (a <tui> without it is the current language) |
V015 | a class:NAME whose NAME is not [a-z_][a-z0-9_-]* or whose value is not path / !path (version="2") |
V016 | 0.2b structure (version="2"): a column whose parent is not a table; a table child other than column and one item, or a second item; text directly in a table; a table item with children or text; an element inside a column; a tab whose parent is not a tabs; a tabs child other than tab, or text directly in a tabs; children or text in a sparkline or a hints; children or text in a checkbox or a select (a <tui> without version) |
V017 | a table without each or without a column child; a tabs without a tab child (version="2"); a select without each or without key (a <tui> without version) |
V018 | checked on a list/table without both each and key (or on a list of static items); a mark that is not 1 or 2 columns wide; mark without checked; on:change on a list without checked (version="2"); single="true" on a list or table without checked (a <tui> without version) |
V019 | a <use> without template, or whose template names no <template>, or that closes a cycle of templates (written in a template that its own template reaches through the uses of the bodies, or met by a copy through an include that a template body as written left unexpanded), each use on the cycle once, naming a simple cycle through it from its own template (the shortest when a search capped at 8 templates finds one within the document's budget of 1000000 steps): whole up to 8 templates, else its first 8 and … (N more); a template id longer than 64 bytes is shown as its first 64 bytes, cut at a rune boundary, then …, wherever a V019 quotes one; a cycle only copies meet (possible only once the definitions' V021 has stopped a template body) is reported at the use that closes it, once, however many copies meet it; the use inserts nothing (a <tui> without version); a second <slot/> in one template, at each further slot, which receives nothing (<template id="T"> has more than one <slot/> (the first is at LOC)); for cycles, a use written in another use's content counts as written where that content is written |
V020 | an <include src> that names a .tcss stylesheet, or whose file is well-formed XML with a root other than <fragment>; the include inserts nothing (current language) |
V021 | the expansions of a document would pass 100000 elements (every element an <include> or a <use> inserts, at every depth, once per copy, plus one for each include or use expanded; text does not count) or 16 MiB of placed source (the size of each fragment file an include places, and of each <template> element a use copies, plus, for each copy, its scoped-id prefix and the , placed by <use …> of its placement suffix (as a diagnostic shows it, without the file name and position) once per element it places, the bytes its with aliases' paths add to the values that name them, and its use's class list once per top-level element), or would nest a node deeper than 256 levels (in the tree tuimark ir prints, the root at 1, the written ancestors counted, and each <include> or <use> a level holding what it inserts): the include or use being expanded inserts nothing, and no later include or use expands; the <template> bodies as written (their includes expanded, for their own checks) share a budget of their own, whose V021 (include src="X" in <template id="T"> exceeds the expansion limit for template definitions …) is reported whether or not a use copies the template: it inserts nothing into the template's own checks, no later include in a template definition expands, and it stops no placement (current language); a fill's elements count once per placement however many slots forward it, a <slot/> is no element but is a level, and a fill written in the document's own file is charged its content's span when it is built, to the expansion of the use that receives it, so a fill past a limit is the V021 of the innermost use being expanded, for a forwarded fill the inner use whose content holds the forwarding slot |
Layout (L…)
Reported while laying out a frame, so they depend on the size you render at.
| Code | When |
|---|---|
L001 | fr child of non-flex parent |
L002 | % child of auto parent on that axis |
L003 | fixed + min exceeds parent (warning; clip); also a table whose visible columns' cell and % widths and auto/fr min-widths, plus the gaps, exceed its width; in a version="3" document, evaluated on the columns left once priority has hidden some |
L004 | modal is not last child of screen |
L005 | more than one bottom-docked status (warning) |
L006 | a scroll/list/table/overflow: scroll viewport can never show part of its content (warning); for a table, a body viewport of 0 rows while it has rows; a textarea, a viewport with the scroll extent of the dump's scroll, that can never show part of its visual lines (a <tui> without version) |
L007 | in a layout: grid container, a child with a document-written width, min-width, max-width, or flex (ignored), or an fr or % height (treated as auto) (warning; version="2") |
L008 | in a version="3" document, a painted text (not visibility: hidden, not a table cell/tab label/hint item) that loses columns (a document-unwritten nowrap line wider than its content box) or lines (more lines than its content box has rows, with overflow: hidden not document-written) without saying so (warning; version="3"); under wrap: pre-wrap (a <tui> without version) the first case never applies, and the second counts the lines pre-wrap makes |
L009 | in a version="3" document, a container that cuts a child, in flow or docked, on an axis it does not itself scroll, when overflow: hidden is not document-written on it; not for a list, a table, or a hints, for a node L003 already reports, or for a child L006 already reports (warning; version="3") |
Bind (B…)
Reported while resolving paths against the JSON data. validate checks them only when you pass --data.
| Code | When |
|---|---|
B001 | each path is missing or not an array (a list, or a col/row/box/table in version="2", or a select in a <tui> without version) |
B002 | if path missing; also a class:NAME guard path; the if or hidden path of a <use>, resolved where it stands, at the use (a <tui> without version) |
B003 | bind path missing (--strict upgrades to error); also a table's bind, placeholder, row key, and column cell templates, reported once per template and path whatever rows are visible; a tabs or sparkline bind; a missing path in a tab's label or short (version="3"); a missing path in a button's label, or in its body when it has no label, reported at the <button> (a <tui> without version); a missing path in a checkbox's bind or label, in a select's bind, label (once per path, not per option), or placeholder, or in an option's key (per option, following --strict), and a missing checked path of a single widget (a <tui> without version); a missing runs path of a <text>, runs path "P" is missing (a <tui> without version); a missing bind or placeholder path of a textarea, as for an input (a <tui> without version) |
B004 | action not in catalog |
B005 | keymap to/when id missing; a tab focus= that names no node, a node inside a list item, or a node outside that tab (version="2"); a modal focus= that names no node, a node outside the modal, or a node inside a list item or an each template (version="3"); a <keymap>'s when whose id names no node, or a node inside a list item or an each template, once, at the <keymap> (version="3"); a to=, when=, or focus= that names a <use> or a <template>, or an id that no node has but an element in a template writes, with its scoped id in the message (a <tui> without version) |
B006 | list + each without key (warning); also table + each without key |
B007 | a built-in action whose target is known without data to be incompatible (from to=, or a when that is exactly #id:focus); static, error (version="2"); evaluated against each row's effective when (version="3", <keymap when>); move-* or check-* naming a checkbox or a select, and check-all naming a list or table with single="true" (a <tui> without version); move-* or check-* naming a textarea, with action="ACTION": its target #ID (from FROM) is a <textarea>, whose caret and offset only its own keys and the wheel move (want a list, a table, a tabs, or a viewport) for move-* and the message of a checkbox for check-* (a <tui> without version) |
B008 | the value at a checked path is present and not an array (error; version="2"); with single="true", present and an array or an object, null being valid (error; a <tui> without version) |
B009 | the value at a sparkline bind is present and not an array, or holds an element that is neither a number nor null (warning; version="2") |
B010 | the value at a tabs bind is present, not null, and not the id of a visible tab; the first visible tab is active and the store is not written (warning; version="2") |
B011 | the value at a checkbox bind is present, not null, and not a boolean; the checkbox shows unchecked, the store is not written for it, and a toggle writes true over it (warning; a <tui> without version) |
B012 | the value at a select bind is present, not null, and not the key of any option, also when the options array is empty; no option is chosen, the placeholder shows, the store is not written for it, and a pick writes over it (warning; a <tui> without version) |
B013 | the value at a <text>'s runs path is present and of the wrong shape: not an array, a string, or null; an element that is not a string or an object; an object without a string text; or a class that is not a string of class names. Reported once per <text> element and frame, for the first bad run; a bad run is left out, or painted without classes when only its class is bad (warning; a <tui> without version). Messages: runs="P" holds TYPE, not an array of runs, a string, or null; runs="P": run N is TYPE, not a string or an object; runs="P": run N has no string "text"; runs="P": run N has a "class" that is not a list of class names |