Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

Diagnostics reference

Every Sneferu diagnostic code, SN1xxx to SN9xxx, with what triggers it and how to fix it.

On this page

Every problem Sneferu reports has a stable code. The format is file:line:col severity CODE message. Errors fail validate and build.

SeriesStage
SN1xxxlexing and parsing templates
SN2xxxtemplate validation (tags, attributes, safety)
SN3xxxpackage, manifest and compile
SN4xxxrendering
SN9xxxartifact (IR) integrity check at load time

SN1xxx Syntax

CodeMeaningFix
SN1001{{ has no closing }}Close the output expression.
SN1002{% has no closing %}Close the directive.
SN1003Unterminated tag or attribute valueClose the quote or the >.
SN1004<hk-schema> has no closing </hk-schema>Add the closing tag.
SN1101An element, {% if %} or {% for %} is never closedAdd the matching closing tag or {% endif %} / {% endfor %}.
SN1102{% elsif %} / {% else %} outside {% if %}, or {% endif %} / {% endfor %} without a matching openerCheck nesting of directives.
SN1103A closing tag closes a different element than the innermost open oneClose inner elements first.
SN1104A closing tag has no matching opening tagRemove it or add the opener.
SN1105Invalid expression, for header or render argumentCheck the grammar in language.md; for is x in expr [limit:n] (or limit: section.settings.x), render is 'name', key: expr. collection() takes a handle or a collection setting; collections() takes no arguments.
SN1106Unknown directiveUse if, elsif, else, endif, for, endfor, render.
SN1107<hk-schema> is not valid JSONFix the JSON (double quotes, no trailing commas).
SN1108Elements and {% if %} / {% for %} nested deeper than 64 levels; the deeper part is not compiledFlatten the markup or move parts into snippets.
SN1109A second {% else %}, or {% elsif %} after {% else %}Keep one {% else %}, last in the {% if %}.

SN2xxx Template validation

CodeMeaningFix
SN2001Element not on the allow-list (see language.md), for example script, style, iframe, form, SVG animate/set/foreignobject, form controls or custom elementsRemove it; put styles in assets/*.css; use hk-* tags.
SN2002Forbidden attribute (on* handlers, srcdoc, formaction, attributename, xml:base) or an invalid attribute nameRemove it.
SN2003Unknown hk-* tagCheck the spelling; the message suggests the closest tag.
SN2004Unknown property on a tag, or tablet- / mobile- on a prop that is not responsiveUse a declared prop; only responsive props take prefixes.
SN2005A required property is missingAdd the property.
SN2006The tag does not accept this childUse an allowed child element.
SN2007Loop limit outside 1..250Use a limit between 1 and 250.
SN2008{% render %} names a snippet that does not existCreate snippets/<name>.snf or fix the name.
SN2009style attribute contains {{ }}Use a class, a token or a component prop.
SN2010Unsafe static URL in a URL attribute (href, any *:href such as xlink:href, src, poster, action, formaction)Only https:, mailto:, tel: or relative URLs are allowed; plain http:, protocol-relative //… and anything containing \ are rejected.
SN2011<hk-slot> used outside a layout or templateMove it into the layout or a template.
SN2012collection(…), product(…), menu(…) or limit: reads a setting that does not exist in the file's <hk-schema> (or in theme.json for settings.*), or that has the wrong typeAdd the setting, or fix its type: collection for collection(), product for product(), menu for menu(), number or range for limit:.
SN2013<hk-part> is not a direct child of a tag that has parts, or its name is missing, contains {{ }}, or is not one of the tag's partsPut it directly inside the tag (for example <hk-product-card>, parts badge and actions) and use one of its part names.
SN2014An interactive tag (a, button, details, label, hk-button, hk-product-card, hk-product-grid, hk-rich-text) is inside <hk-part name="badge"> of <hk-product-card>; the badge renders inside the card's link.Use plain markup in the badge, or move the interactive element to the actions part.
SN2015Warning: a literal <img> has no width and height attributeSet both, so the page does not jump while the image loads (see Images and assets). hk-image sets them from its props.
SN2016Warning: a template reads an object of another page type (product outside product, collection or paginate outside collection and search, ...); a loop variable of the same name is fineMove the markup to the right template, or to a section used there. See Page types.
SN2017<hk-section-group> has no fixed name, or the name is not header, footer or announcementWrite name="header" as plain text.
SN2018<hk-section-group> outside layout/theme.snfPlace groups in the layout.
SN2019The same group is placed twice in the layoutPlace each group once.
SN2020An attribute value contains a {% %} directive, such as class="btn {% if x %}is-on{% endif %}". Directives work around elements, not inside an attribute, so it would otherwise render as stray class namesPrint a value with {{ }}: class="btn btn-{{ block.settings.style }}" with a select setting. Or put the {% if %} around two versions of the element.
SN2021<hk-app-block> names an app and block that are not a pair on the platform's closed list of app blocks.Use a pair the platform offers, or let the editor's section place it. There is no way to add your own address.

SN3xxx Package, manifest and compile

CodeMeaningFix
SN3001theme.json is missingAdd it at the theme root.
SN3002Invalid file path (absolute, .., bad characters, backslash, symlink)Use lower-case names with letters, digits, ., _, -, and start every name with a letter or digit (a folder such as assets/_old/ is rejected). The message names the segment that failed. A symlink is refused by the CLI when it reads the folder: copy the file instead.
SN3003File type or location not allowedPut files in the allowed folders with the allowed extensions.
SN3004Duplicate fileRemove the duplicate.
SN3005Too many files (max 400)Remove unused files.
SN3006Package larger than 25 MBCompress or remove assets.
SN3007An asset is larger than 2 MBCompress or split it.
SN3008A template is larger than 300 KBSplit it into sections or snippets.
SN3009theme.json is not an object or not valid JSONFix the JSON.
SN3010engine is not "hk2"Set "engine": "hk2".
SN3011engineCompatibility does not include the current engineUse a range that includes 2.0.0, such as ^2.0.0.
SN3012Invalid id3-41 characters: lower-case letters, digits, dashes, starting with a letter.
SN3013name is missing or not a stringWrite the theme name as a string.
SN3014version is not x.y.zUse semantic versioning.
SN3015author is missingAdd it.
SN3016description is missing or not a stringWrite a one-line description as a string.
SN3017category is missingAdd it.
SN3018defaultLocale is not en/ar, locales omits it, or lists another codeFix defaultLocale and locales.
SN3019A required colour token is missing or not #RRGGBBSet primary, secondary, accent, background, text.
SN3020A template references a section that does not existCreate the section or fix the type.
SN3021settings in theme.json is not an objectUse an object of fields.
SN3022File is not valid UTF-8Re-save as UTF-8.
SN3023layout/theme.snf is missingAdd the layout.
SN3024templates/index.snf is missingAdd the index template.
SN3025A locale file is not valid JSON, or is not a flat object whose values are all stringsUse { "key": "text", ... } with string values only.
SN3027Snippet include cycle, e.g. snippet include cycle: a → b → aBreak the cycle; a snippet may not (indirectly) render itself.
SN3026A template's schema sections (or a section's blocks) is malformedUse an array of { "type": "...", "settings": {...}, "blocks": [...] }.
SN3028A template's default section lists a block type that is not in blocks/Create the block or fix the type.
SN3029A default section (in a template or a group) lists a block its section or parent block does not allow, more than blocks.max, or blocks nested deeper than two levelsAdd the type to the section's blocks.allowed, or list fewer blocks.
SN3030A section or block <hk-schema> lacks a name or has bad settingsAdd a name string; settings must be an object.
SN3031A setting's label is not a string (warning)Write the label as a string.
SN3032tokens.fonts is not an object, has a key other than heading, body, mono, or names a font that is not in the catalogueUse one of the catalogue families exactly as written (see Fonts).
SN3033money in theme.json is not { "format": "decimal" } or { "format": "whole" }Use one of the two formats, or remove money for the default.
SN3034Warning: an asset in assets/ is not served on the store (only images are): a .js, a font or an .icoRemove it, or use tokens.fonts, hk-icon or inline SVG instead (see Images and assets).
SN3035A template is not named after a page typeUse index, product, collection, search, cart, page or 404; only product, collection and page take an alternate (product.codes).
SN3036A groups/<name>.json is not valid JSON, is not { "sections": [ … ] }, or is over 64 KBFix the file. See Section groups.
SN3037A group file lists a section that does not existCreate the section or fix the type.
SN3038A group file entry is malformed: more than 12 sections, a bad or duplicate id, a bad block_orderUse ids of letters, digits, - and _; list only existing block ids in block_order.
SN3039Warning: a group file for a group the layout never placesAdd <hk-section-group name="…" /> to the layout, or delete the file.
SN3040A section's templates list is empty, too long or names something that is not a page type, an alternate or a groupUse page types, product.<alt> or header, footer, announcement.
SN3041A default section sits where its templates list says it may not (in a template or a group)Add the template or group to the list, or use another section.
SN3042blocks.allowed names a block that is not in blocks/Create the block or fix the name.
SN3043A file in sections/, blocks/ or snippets/ is named hk-…; that prefix is reserved for the default store's own sections, blocks and snippetsRename the file (and every reference to it) without the hk- prefix.
SN3044One name in both forms in one folder, such as sections/hero.snf and sections/hero.sneferuKeep one file; .snf is the current extension, .sneferu still works.
SN3045A migrations/*.json file is malformed: not JSON, unknown keys, bad names, a rename to itself, two names renamed to one, or a name both renamed and removedUse { "from", "to", "settings"?, "sections"?, "blocks"? }, each with rename (old: new) and remove (list).
SN3046A migration's versions are wrong: from is not older than to, to is newer than the theme's version, two files cover the same step, or the steps form a cycleFix the versions; each file carries one step, with from < to <= version.
SN3047A migration renames to a setting, section or block the current theme does not have, or removes one it still hasRename only to names that exist now; remove only what is gone.
SN3048settings in theme.json declares a setting with the id checkout; the store keeps the merchant's checkout branding under that keyRename the setting. Brand the checkout with the top-level checkout block (see Checkout branding).
SN3049Warning: checkout in theme.json is not an object; it is ignoredWrite "checkout": { … } with the checkout settings, or remove it.
SN3050Warning: checkout has a key that is not a checkout setting; it is droppedUse color_accent, color_button, color_button_text, color_background, color_surface, color_border, color_text, font, radius, button_shape, logo, chrome or trust_note.
SN3051Warning: checkout.logo_image is set; the checkout logo image is the merchant's to upload, so it is droppedRemove it. Set "logo": "store" to show the store's logo.
SN3052Warning: a checkout colour is not #rgb or #rrggbb; it is droppedWrite the colour as hex, such as #0f766e.
SN3053Warning: checkout.font is not "default" or a family in the font catalogue; it is droppedUse "default" (the body font) or a catalogue family exactly as written (see Fonts).
SN3054Warning: checkout.radius is outside 0–24 or not a whole number (it is clamped and rounded), or is not a number (it is dropped)Use a whole number of pixels from 0 to 24.
SN3055Warning: checkout.button_shape, logo or chrome is not one of its values; it is droppedbutton_shape: square, rounded, pill. logo: store, custom, none. chrome: theme, minimal.
SN3056Warning: checkout.trust_note is not { "ar": text, "en": text }, or has another language or a non-text value; that part is droppedWrite plain text for ar and en.
SN3057Warning: a checkout.trust_note text is over 140 characters; it is cut to 140Shorten the note.
SN3059Warning: tokens.layout.contentWidth is not "full" or "<3-4 digits>px"; it is ignoredUse "full" or a width such as "1200px"
SN3058Warning: a key in tokens.colors is not lower-case letters, digits and dashes (for example sageSoft); it is not emitted as a --hk-color-* variableRename the key to kebab-case, such as sage-soft, and use var(--hk-color-sage-soft).

SN4xxx Rendering

These are reported by the runtime while rendering a page. The page still renders; the affected part is dropped.

CodeMeaningFix
SN4001Render budget exceeded (nodes, loop iterations or output size); the section degradesLower loop limits or simplify the section.
SN4002Snippet or block include depth exceeded (8); reported once per pageRemove recursive or deeply nested includes.
SN4003Maximum nesting depth (64) reached; reported once per pageFlatten the markup.
SN4004Snippet not found at render timeCreate the snippet.
SN4005Component not available in the registryUse a tag the platform provides.
SN4006A component failed while renderingCheck the props passed to it.
SN4010Template not foundCreate templates/<name>.snf.
SN4011A page section's type does not exist in the theme, or the page section is malformedAdd the section or remove it from the page.
SN4012A block's type does not exist in the theme; the block is skippedAdd blocks/<type>.snf or remove the block.
SN4013A <hk-section-group> was reached outside the layout; it renders nothing (reported once per page)Place section groups in layout/theme.snf only.
SN4014A section in a group (header, footer, announcement) has a templates list that does not name that group; the section is skippedAdd the group to the section's templates, or remove the section from the group.

SN9xxx Artifact integrity

The runtime re-checks a compiled artifact before rendering. These indicate a corrupt or tampered artifact; rebuild it with sneferu build.

CodeMeaningFix
SN9001Unknown IR node kindRebuild with the current SDK.
SN9002Unknown component in the IRRebuild; check the tag exists.
SN9003Unknown filter in the IRRebuild.
SN9004Loop limit in the IR is neither a whole number in 1..250 nor a section, block or theme setting pathRebuild.
SN9005Invalid expression in the IRRebuild.
SN9006Unknown lookup in the IRRebuild.
SN9007Invalid property value in the IRRebuild.
SN9008Malformed IR structure (expected array or object)Rebuild.
SN9009IR nested too deeplyFlatten the templates and rebuild.
SN9010An html node is not a stringRebuild.
SN9011Element not on the allow-list in the IRRebuild; the element is not allowed.
SN9012Attribute not allowed in the IR (on*, srcdoc, formaction, attributename, xml:base, dynamic style)Rebuild.
SN9013Invalid attribute sink, or a URL attribute (href, *:href, src, …) without the url sinkRebuild.
SN9014A static HTML chunk does not match the compiler's output grammar (comment, <!…>, <?…>, CDATA, raw </> in text, unquoted or single-quoted value, markup inside <title>, tag left open, disallowed element) or has a bad attribute (on*, forbidden name, javascript:/vbscript:/data:text/html value, unsafe URL). The compiler also reports this for its own output, e.g. style="background:url(javascript:…)"Rebuild; if it comes from sneferu build, remove the offending attribute value.
SN9015The artifact's structure is malformed (missing or wrong-typed manifest, sections, schemas, fields, …), or rendering failed unexpectedly; the page is not renderedRebuild with sneferu build; report the message if it persists.
SN9016A template, section, block or snippet in the artifact places <hk-section-group>; only the layout may. The artifact is rejectedRebuild with sneferu build (the compiler reports SN2018).
SN9017A collection(), product() or menu() lookup in the artifact does not have exactly one argument that is a string or a setting path (section.settings.x, block.settings.x, settings.x). The artifact is rejectedRebuild with sneferu build (the compiler reports SN1105).

Next steps