Every code, explained
When Piko finds a problem in a template or while a page renders, it reports it with a stable code. Here is what each one means and how to fix it.
$ piko explain T141prints the same explanation in your terminalerrorStops the build, or marks a render that failed.
warningA likely mistake. The build carries on.
infoWorth knowing. The build carries on.
Template expressions
T0xxReported while a template's expressions and directives are parsed, before any types are checked.
- T001Invalid number literalA number in a template expression is malformed.error
- T002Invalid string literalA quoted string in a template expression is malformed.error
- T003Invalid escape sequenceA rune literal contains an escape sequence that is not valid.error
- T004Invalid date, time or durationA date, time, datetime or duration literal does not match its expected format.error
- T005Invalid rune literalA rune literal does not contain exactly one character.error
- T006Invalid template literalA template literal is not enclosed in backticks.error
- T007Unterminated interpolationAn interpolation is opened but never closed.error
- T008Unexpected tokenThe parser found a token where it expected a value or a different token.error
- T009Unexpected end of expressionThe expression ended before it was complete.error
- T010Missing identifierAn identifier is missing after '.', '?.' or '@'.error
- T011Missing operandAn operator has nothing to operate on.error
- T012Missing closing bracketA ']', ')' or '}' is missing.error
- T013Missing separatorA ',' or ':' is missing between parts of an expression.error
- T014Incomplete expressionAn index, function call, type argument list or ternary is not fully written.error
- T015Expression nested too deeplyAn expression is nested more deeply than the parser allows.error
- T016Feature not allowed hereThe expression uses a feature this context does not allow.error
- T017Unreadable expressionThe expression contains characters the lexer cannot read.error
- T018Unexpected text after expressionTokens remain after a complete expression.error
- T019Unexpected commaA comma is used where it is not an operator.error
- T020Conflicting directivesAn element has two directives that cannot be combined.error
- T021Duplicate directiveThe same directive appears more than once on an element.warning
- T022Invalid directive valueA directive's value is empty or not valid.error
- T023p-else without p-ifA p-else or p-else-if does not follow an element with p-if or p-else-if.error
- T024Directive written before p-forA directive is written before p-for, but p-for is evaluated first.warning
- T025Directive not supported on this elementA directive is used on an element that does not support it.error
- T026p-for without p-keyA p-for loop has no p-key.warning
- T027Static and dynamic attribute conflictAn attribute is set statically and also by a dynamic binding.warning
- T028Directive overwrites contentAn element has children that p-text or p-html will replace.warning
- T029Invalid CSS selectorA CSS selector could not be parsed.error
- T030Internal parser errorThe expression parser reached a state it should not. This should not normally happen.error
- T031Duplicate attributeThe same static attribute is written more than once on an element.warning
- T032Static _memo attribute_memo is written as a static attribute instead of the p-memo directive.warning
Template analysis
T1xxReported while templates are type-checked against their Go code, and while components, props, assets and styles are linked.
- T100Undefined variableA template refers to a name that is not defined.error
- T101Type mismatchA value's type does not match the type expected where it is used.errorwarning
- T102Circular dependencyComponents, partials or imports depend on each other in a cycle.error
- T103Unresolved importAn import path for a component, partial or Go package could not be resolved.error
- T104Email element in a web pageA PikoML <pml-*> element is used outside an email template.warning
- T105Missing is attributeA <piko:partial> or <piko:element> has no is attribute.error
- T106Invalid is attributeThe is attribute on <piko:partial> or <piko:element> has a value it cannot use.error
- T107Undefined partial aliasA <piko:partial is> names an alias that is not imported.error
- T108Partial could not be loadedAn imported partial's file could not be loaded.error
- T109No such slotContent is passed to a slot the component does not have.warning
- T110Name shadows a built-inA function or variable has the same name as a built-in or an import alias.warning
- T111Script block has no languageA <script> block has no lang or type attribute.warning
- T112Asset not foundAn asset path could not be resolved, or an image's responsive attributes are incomplete.warning
- T113Asset profile not foundAn asset profile named on a tag is missing from the configuration or has no settings.warning
- T114CSS import failedA CSS @import could not be resolved, or imports form a cycle.error
- T115CSS errorThe CSS processor reported a problem in a component's styles.errorwarninginfo
- T116Go compilation errorThe Go compiler rejected code generated from a component, and the error is mapped back to the .pk file.error
- T117Collection errorThe collection system failed while resolving a collection's types.error
- T118Analysis failedA stage of template analysis failed and could not continue.error
- T119$event or $form misused$event or $form is used outside an event handler, or used in a way it does not support.error
- T120Invalid p-for expressionA p-for expression is not a valid loop, or loops over a type that cannot be iterated.error
- T121Loop variable shadows a built-inA p-for loop variable has the same name as a built-in symbol or global function.warning
- T122Condition is not a booleanA p-if, p-else-if or p-show expression is not a boolean.error
- T123p-model target is not assignableA p-model expression is not a variable that can be assigned to.error
- T124Binding has the wrong typeA p-class, :class, p-style, p-key or p-context binding has a type it does not expect.errorwarning
- T125Attribute value is not textA dynamic attribute's value has no defined text form.warning
- T126Unknown propA prop is passed to a component that does not define it.warning
- T127Missing required propA component is used without a prop it requires.error
- T128Prop has the wrong typeThe value passed to a prop does not match the prop's declared type.error
- T129Prop bound twiceA prop is given both a standard binding and a server-only binding.warning
- T130Invalid prop defaultA prop's default value or default factory does not fit the prop's type.errorwarning
- T131Invalid Props structA component's Props struct is malformed.error
- T132Invalid query propA prop bound to a query parameter has an invalid query tag or type.errorwarning
- T133Handler arguments do not matchA handler or action call has the wrong number or types of arguments.warning
- T134Invalid event handlerAn event handler is not a function call, or uses an unknown or incompatible modifier.error
- T135Built-in function misusedA built-in function such as len, cap, append, min or max is called incorrectly.error
- T136Translation function misusedA translation function such as T, LT or LTC is called incorrectly, or names a missing key.errorinfowarning
- T137No such field or methodA field, method or package member does not exist.error
- T138Invalid indexA value is indexed when it cannot be, or with an index of the wrong type.error
- T139Invalid callA value that is not a function is called, or a function is called with the wrong number of arguments.error
- T140Logical operator on non-booleansAn operand of &&, || or ! is not a boolean, or the operands of || are incompatible.error
- T141Invalid comparisonThe two sides of a comparison cannot be compared.error
- T142Invalid arithmeticAn arithmetic operator is used with types it is not defined for.error
- T143?? operands do not matchThe two sides of ?? have incompatible types.warning
- T144String concatenationnot reportedA string concatenation involves a value that cannot be turned into a string.error
- T145Conversion failedA value could not be converted to the type it is needed as.errorwarning
- T146Formatting function misusedF or LF is called incorrectly, or with a value it may not format.errorwarning
- T147Action errorAn action could not be discovered, or a template calls it incorrectly.errorwarning
- T148Entry point not foundAn entry point of the component dependency graph could not be resolved.error
- T149Client script problemA client script cannot be parsed, an event handler is missing from it, or an imported partial is never used.errorwarning
- T150Partial CSS errorA partial's CSS could not be processed when the partial was expanded.error
- T151Computed property not supportedMember access with [...] is used where it is not supported.error
- T152Suggested prop namenot reportedAn unknown prop name is close to one the component defines.warning
- T153Collection provider not registeredA p-collection names a provider that is not registered.warning
- T154sitemap marker ignoredThe sitemap marker is on a tag that cannot add an image to the sitemap.warning
- T155Collection source not importedA p-collection-source alias matches no import in the Go script block.error
Rendering
R0xxReported by generated code while a page renders. They appear in the server log rather than in build output, and the page still renders: a nil read or an out-of-range index gives a zero value instead of a panic.
- R001Render returned an errorA page or component's Render function returned an error.error
- R002Partial Render returned an errorA partial's Render function returned an error.error
- R003Field read through nilA template read a field through a pointer that was nil.warning
- R004Index into nilA template indexed a slice or map that was nil.warning
- R005Index out of rangeA template indexed a slice outside its length.warning
- R006<piko:element> has no tagA <piko:element :is> expression resolved to an empty tag name.error
- R007<piko:element> tag not allowedA <piko:element :is> expression resolved to a reserved tag.error
Codes starting with Q come from Piko's SQL generator, Seagull, and are explained at seagull.sh. A code keeps its meaning, and a number is never reused.