Errors
All 121 Sneferu diagnostic codes, one page each: message, what failed, how to fix it and a minimal failing and working example.
On this page
Every diagnostic code Sneferu reports, one page each: the message the compiler prints, what failed, how to fix it and, where one exists, a minimal failing and working example. 121 codes. The one-table version is the Diagnostics reference.
121 of 121 codes
- SN1001 error {{ has no closing }}
- SN1002 error {% has no closing %}
- SN1003 error Unterminated tag or attribute value
- SN1004 error <hk-schema> has no closing </hk-schema>
- SN1101 error An element, {% if %} or {% for %} is never closed
- SN1102 error {% elsif %} / {% else %} outside {% if %}, or {% endif %} / {% endfor %} without a matching opener
- SN1103 error A closing tag closes a different element than the innermost open one
- SN1104 error A closing tag has no matching opening tag
- SN1105 error Invalid expression, for header or render argument
- SN1106 error Unknown directive
- SN1107 error <hk-schema> is not valid JSON
- SN1108 error Elements and {% if %} / {% for %} nested deeper than 64 levels; the deeper part is not compiled
- SN1109 error A second {% else %}, or {% elsif %} after {% else %}
- SN2001 error Element not on the allow-list (see language.md), for example script, style, iframe, form, SVG animate/set/foreignobject, form controls or custom elements
- SN2002 error Forbidden attribute (on* handlers, srcdoc, formaction, attributename, xml:base) or an invalid attribute name
- SN2003 error Unknown hk-* tag
- SN2004 error Unknown property on a tag, or tablet- / mobile- on a prop that is not responsive
- SN2005 error A required property is missing
- SN2006 error The tag does not accept this child
- SN2007 error Loop limit outside 1..250
- SN2008 error {% render %} names a snippet that does not exist
- SN2009 error style attribute contains {{ }}
- SN2010 error Unsafe static URL in a URL attribute (href, any *:href such as xlink:href, src, poster, action, formaction)
- SN2011 error <hk-slot> used outside a layout or template
- SN2012 error collection(…), 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 type
- SN2013 error <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 parts
- SN2014 error An 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.
- SN2015 warning Warning: a literal <img> has no width and height attribute
- SN2016 warning Warning: 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 fine
- SN2017 error <hk-section-group> has no fixed name, or the name is not header, footer or announcement
- SN2018 error <hk-section-group> outside layout/theme.snf
- SN2019 error The same group is placed twice in the layout
- SN2020 error An 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 names
- SN2021 error <hk-app-block> names an app and block that are not a pair on the platform's closed list of app blocks.
- SN3001 error theme.json is missing
- SN3002 error Invalid file path (absolute, .., bad characters, backslash, symlink)
- SN3003 error File type or location not allowed
- SN3004 error Duplicate file
- SN3005 error Too many files (max 400)
- SN3006 error Package larger than 25 MB
- SN3007 error An asset is larger than 2 MB
- SN3008 error A template is larger than 300 KB
- SN3009 error theme.json is not an object or not valid JSON
- SN3010 error engine is not "hk2"
- SN3011 error engineCompatibility does not include the current engine
- SN3012 error Invalid id
- SN3013 error name is missing or not a string
- SN3014 error version is not x.y.z
- SN3015 error author is missing
- SN3016 error description is missing or not a string
- SN3017 error category is missing
- SN3018 error defaultLocale is not en/ar, locales omits it, or lists another code
- SN3019 error A required colour token is missing or not #RRGGBB
- SN3020 error A template references a section that does not exist
- SN3021 error settings in theme.json is not an object
- SN3022 error File is not valid UTF-8
- SN3023 error layout/theme.snf is missing
- SN3024 error templates/index.snf is missing
- SN3025 error A locale file is not valid JSON, or is not a flat object whose values are all strings
- SN3027 error Snippet include cycle, e.g. snippet include cycle: a → b → a
- SN3026 error A template's schema sections (or a section's blocks) is malformed
- SN3028 error A template's default section lists a block type that is not in blocks/
- SN3029 error A 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 levels
- SN3030 error A section or block <hk-schema> lacks a name or has bad settings
- SN3031 warning A setting's label is not a string (warning)
- SN3032 error tokens.fonts is not an object, has a key other than heading, body, mono, or names a font that is not in the catalogue
- SN3033 error money in theme.json is not { "format": "decimal" } or { "format": "whole" }
- SN3034 warning Warning: an asset in assets/ is not served on the store (only images are): a .js, a font or an .ico
- SN3035 error A template is not named after a page type
- SN3036 error A groups/<name>.json is not valid JSON, is not { "sections": [ … ] }, or is over 64 KB
- SN3037 error A group file lists a section that does not exist
- SN3038 error A group file entry is malformed: more than 12 sections, a bad or duplicate id, a bad block_order
- SN3039 warning Warning: a group file for a group the layout never places
- SN3040 error A section's templates list is empty, too long or names something that is not a page type, an alternate or a group
- SN3041 error A default section sits where its templates list says it may not (in a template or a group)
- SN3042 error blocks.allowed names a block that is not in blocks/
- SN3043 error A file in sections/, blocks/ or snippets/ is named hk-…; that prefix is reserved for the default store's own sections, blocks and snippets
- SN3044 error One name in both forms in one folder, such as sections/hero.snf and sections/hero.sneferu
- SN3045 error A 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 removed
- SN3046 error A 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 cycle
- SN3047 error A migration renames to a setting, section or block the current theme does not have, or removes one it still has
- SN3048 error settings in theme.json declares a setting with the id checkout; the store keeps the merchant's checkout branding under that key
- SN3049 warning Warning: checkout in theme.json is not an object; it is ignored
- SN3050 warning Warning: checkout has a key that is not a checkout setting; it is dropped
- SN3051 warning Warning: checkout.logo_image is set; the checkout logo image is the merchant's to upload, so it is dropped
- SN3052 warning Warning: a checkout colour is not #rgb or #rrggbb; it is dropped
- SN3053 warning Warning: checkout.font is not "default" or a family in the font catalogue; it is dropped
- SN3054 warning Warning: checkout.radius is outside 0–24 or not a whole number (it is clamped and rounded), or is not a number (it is dropped)
- SN3055 warning Warning: checkout.button_shape, logo or chrome is not one of its values; it is dropped
- SN3056 warning Warning: checkout.trust_note is not { "ar": text, "en": text }, or has another language or a non-text value; that part is dropped
- SN3057 warning Warning: a checkout.trust_note text is over 140 characters; it is cut to 140
- SN3059 warning Warning: tokens.layout.contentWidth is not "full" or "<3-4 digits>px"; it is ignored
- SN3058 warning Warning: a key in tokens.colors is not lower-case letters, digits and dashes (for example sageSoft); it is not emitted as a --hk-color-* variable
- SN4001 error Render budget exceeded (nodes, loop iterations or output size); the section degrades
- SN4002 error Snippet or block include depth exceeded (8); reported once per page
- SN4003 error Maximum nesting depth (64) reached; reported once per page
- SN4004 error Snippet not found at render time
- SN4005 error Component not available in the registry
- SN4006 error A component failed while rendering
- SN4010 error Template not found
- SN4011 error A page section's type does not exist in the theme, or the page section is malformed
- SN4012 error A block's type does not exist in the theme; the block is skipped
- SN4013 error A <hk-section-group> was reached outside the layout; it renders nothing (reported once per page)
- SN4014 error A section in a group (header, footer, announcement) has a templates list that does not name that group; the section is skipped
- SN9001 error Unknown IR node kind
- SN9002 error Unknown component in the IR
- SN9003 error Unknown filter in the IR
- SN9004 error Loop limit in the IR is neither a whole number in 1..250 nor a section, block or theme setting path
- SN9005 error Invalid expression in the IR
- SN9006 error Unknown lookup in the IR
- SN9007 error Invalid property value in the IR
- SN9008 error Malformed IR structure (expected array or object)
- SN9009 error IR nested too deeply
- SN9010 error An html node is not a string
- SN9011 error Element not on the allow-list in the IR
- SN9012 error Attribute not allowed in the IR (on*, srcdoc, formaction, attributename, xml:base, dynamic style)
- SN9013 error Invalid attribute sink, or a URL attribute (href, *:href, src, …) without the url sink
- SN9014 error A 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:…)"
- SN9015 error The artifact's structure is malformed (missing or wrong-typed manifest, sections, schemas, fields, …), or rendering failed unexpectedly; the page is not rendered
- SN9016 error A template, section, block or snippet in the artifact places <hk-section-group>; only the layout may. The artifact is rejected
- SN9017 error A 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 rejected
How to read a code
The format is file:line:col severity CODE message. Errors fail validate, build and push; warnings do not. The series tells the stage:
| Series | Stage |
|---|---|
| SN1xxx | lexing and parsing templates |
| SN2xxx | template validation (tags, attributes, safety) |
| SN3xxx | package, manifest and compile |
| SN4xxx | rendering |
| SN9xxx | artifact (IR) integrity check at load time |
86 of 121 codes have a verified example. Codes without one are raised while rendering or when a built file is loaded, or by size limits that a short example cannot show.
