octobercms/october · error · Twig\Error\SyntaxError

Cannot use lazy mode with partial tag. Did you mean ajaxPart

Error message

Cannot use lazy mode with partial tag. Did you mean ajaxPartial?

What it means

Error "Cannot use lazy mode with partial tag. Did you mean ajaxPartial?" thrown in octobercms/october.

Source

Thrown at modules/cms/twig/tokenparser/PartialTokenParser.php:50

        $paramNames = [];
        $hasBody = $hasOnly = $hasLazy = false;
        $body = null;

        $isAjax = $this->getTag() === 'ajaxPartial';

        // Parse partial name (first argument)
        $nodes['__partial_name'] = $this->parser->parseExpression();

        // Parse optional parameters
        while (!$stream->test(TwigToken::BLOCK_END_TYPE)) {
            $current = $stream->next();

            $isKeywordCandidate = !$stream->test(TwigToken::OPERATOR_TYPE, '=')
                && !$stream->test(TwigToken::OPERATOR_TYPE, '-');

            if ($current->test(TwigToken::NAME_TYPE, 'lazy') && $isKeywordCandidate) {
                if (!$isAjax) {
                    throw new TwigErrorSyntax(
                        'Cannot use lazy mode with partial tag. Did you mean ajaxPartial?',
                        $stream->getCurrent()->getLine(),
                        $stream->getSourceContext()
                    );
                }
                $hasLazy = true;
                continue;
            }

            if ($current->test(TwigToken::NAME_TYPE, 'body') && $isKeywordCandidate) {
                $hasBody = true;
                continue;
            }

            if ($current->test(TwigToken::NAME_TYPE, 'only') && $isKeywordCandidate) {
                $hasOnly = true;
                continue;
            }

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/cms/twig/tokenparser/PartialTokenParser.php:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/79b6c6039ca895d3. Report an issue: GitHub.