{"record":{"id":"1646028eb62dad42","repo":"octobercms/october","slug":"invalid-syntax-in-the-framework-tag-line-s","errorCode":null,"errorMessage":"Invalid syntax in the framework tag. Line %s","messagePattern":"Invalid syntax in the framework tag\\. Line (.+?)","errorType":"exception","errorClass":"Twig\\Error\\SyntaxError","httpStatus":null,"severity":"error","filePath":"modules/cms/twig/tokenparser/FrameworkTokenParser.php","lineNumber":38,"sourceCode":"class FrameworkTokenParser extends TwigTokenParser\n{\n    /**\n     * Parses a token and returns a node.\n     * @return FrameworkNode\n     */\n    public function parse(TwigToken $token)\n    {\n        $lineno = $token->getLine();\n        $stream = $this->parser->getStream();\n\n        $options = [];\n\n        while (!$stream->test(TwigToken::BLOCK_END_TYPE)) {\n            if ($stream->test(TwigToken::NAME_TYPE)) {\n                $options[] = strtolower(trim($stream->next()->getValue()));\n            }\n            else {\n                throw new TwigErrorSyntax(\n                    sprintf('Invalid syntax in the framework tag. Line %s', $lineno),\n                    $stream->getCurrent()->getLine(),\n                    $stream->getSourceContext()\n                );\n            }\n        }\n\n        $stream->expect(TwigToken::BLOCK_END_TYPE);\n\n        return new FrameworkNode($options, $lineno, $this->getTag());\n    }\n\n    /**\n     * Returns the tag name associated with this token parser.\n     * @return string\n     */\n    public function getTag()\n    {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/twig/tokenparser/FrameworkTokenParser.php#L20-L56","documentation":"The {% framework %} tag accepts only bare word options (NAME tokens), lowercased into the framework node's options - e.g. {% framework extras %}. Any token that is not a NAME - a quoted string, number, equals sign, or operator - throws this SyntaxError with the tag's starting line. Unlike the component/content tags there are no assignments at all.","triggerScenarios":"Writing {% framework 'extras' %} (quoted string instead of the bare word), {% framework extras=true %} (attempted assignment), or {% framework 1 %} - each produces a non-NAME token in the loop.","commonSituations":"Quoting the option out of string-literal habit; copying the syntax from the {% scripts %} or {% styles %} variants that behave differently; adding unsupported key=value flags.","solutions":["Use bare words without quotes or equals signs: {% framework extras %}.","Pass only documented options (e.g. extras); anything else belongs in theme configuration, not this tag.","Re-save the template - compilation fails until the tag is fixed."],"exampleFix":"{# before: quoted option - not a NAME token #}\n{% framework 'extras' %}\n\n{# after #}\n{% framework extras %}","handlingStrategy":"validation","validationCode":"$env = app('twig.environment');\ntry {\n    $env->parse($env->tokenize(new \\Twig\\Source($templateBody, $fileName)));\n} catch (\\Twig\\Error\\SyntaxError $e) {\n    // reject invalid {% framework %} syntax at lint time\n}","typeGuard":null,"tryCatchPattern":"try {\n    $env->parse($env->tokenize(new \\Twig\\Source($body, $name)));\n} catch (\\Twig\\Error\\SyntaxError $e) {\n    // 'Invalid syntax in the framework tag' - use bare word options only\n}","preventionTips":["Write options as bare words: {% framework extras %} - no quotes, no equals.","Do not invent key=value flags for this tag.","Lint templates in CI before release."],"tags":["twig","syntax-error","framework-tag","template"],"backgroundTag":"template-syntax-error","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}