{"record":{"id":"d0b08a79cf9700f5","repo":"octobercms/october","slug":"error-parsing-the-name-attribute-value-e","errorCode":null,"errorMessage":"Error parsing the ${name} attribute value. ${e}","messagePattern":"Error parsing the (.+?) attribute value\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/backend/assets/foundation/controls/autocomplete/autocomplete.js","lineNumber":384,"sourceCode":"\n    $.fn.autocomplete.noConflict = function () {\n        $.fn.autocomplete = old\n        return this\n    }\n\n\n    /* AUTOCOMPLETE DATA-API\n     * ================== */\n\n    function paramToObj(name, value) {\n        if (value === undefined) value = ''\n        if (typeof value == 'object') return value\n\n        try {\n            return oc.parseJSON(\"{\" + value + \"}\")\n        }\n        catch (e) {\n            throw new Error('Error parsing the '+name+' attribute value. '+e)\n        }\n    }\n\n    $(document).on('focus.autocomplete.data-api', '[data-control=\"autocomplete\"]', function (e) {\n        var $this = $(this)\n        if ($this.data('autocomplete')) return\n\n        var opts = $this.data()\n\n        if (opts.source) {\n            opts.source = paramToObj('data-source', opts.source)\n        }\n\n        $this.autocomplete(opts)\n    })\n\n}(window.jQuery);\n","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/assets/foundation/controls/autocomplete/autocomplete.js#L366-L402","documentation":"October CMS's `{% partial %}` Twig tag renders immediately, while the `lazy` keyword (deferred, AJAX-loaded content) belongs only to the `{% ajaxPartial %}` tag. In PartialTokenParser::parse, `$isAjax` is true only when getTag() returns 'ajaxPartial'; a `lazy` NAME token inside a plain `{% partial %}` is therefore rejected at compile time with this SyntaxError. The message deliberately points you at ajaxPartial because that is the tag that supports lazy mode.","triggerScenarios":"Writing `{% partial \"cards\" lazy %}` in any CMS page, layout or partial template. Any template that contains the word `lazy` as a bare keyword (not `lazy=...` and not part of a hyphenated name) inside a `{% partial %}` tag fails the moment Twig parses the template.","commonSituations":"Copying a lazy-loading example from the ajaxPartial docs but keeping the `partial` tag name; upgrading a project where templates previously used `ajaxPartial`-style syntax on the wrong tag; following tutorials that mix the two tags.","solutions":["Change the tag from `{% partial \"name\" lazy %}` to `{% ajaxPartial \"name\" lazy %}` — lazy mode is only supported there.","If you do not want AJAX/deferred loading, simply remove the `lazy` keyword from the `{% partial %}` tag.","If you meant a parameter literally named lazy, write it as a pair: `{% partial \"name\" lazy=true %}` (this parses as an expression and is not treated as the keyword)."],"exampleFix":"// before\n{% partial \"cards\" lazy %}\n\n// after\n{% ajaxPartial \"cards\" lazy %}","handlingStrategy":"validation","validationCode":"// Lint templates before deploy: flag `lazy` used inside a plain {% partial %} tag\n$contents = file_get_contents($templatePath);\nif (preg_match('/{%-?\\s*partial\\b[^%]*?\\blazy\\b(?!\\s*=)/', $contents)) {\n    throw new RuntimeException(\"{$templatePath}: `lazy` requires the {% ajaxPartial %} tag\");\n}","typeGuard":null,"tryCatchPattern":"// Parsing happens at compile time; surface it cleanly instead of a 500\ntemplateSyntax: try {\n    $twig->load($templateName);\n} catch (Twig\\Error\\SyntaxError $e) {\n    // $e->getMessage() includes the file and line, e.g. the ajaxPartial hint\n    Log::warning('Template syntax: '.$e->getMessage());\n}","preventionTips":["Use {% ajaxPartial %} whenever a partial needs lazy or deferred loading.","Run a template lint/compile step in CI so tag misuse fails the build, not the page.","Write lazy parameters as key=value if the word lazy is genuinely a parameter name."],"tags":["twig","october-cms","partial","template-syntax","compile-time"],"backgroundTag":"twig-syntax-error","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}