octobercms/october · error · Error

Error parsing Inspector configuration. ${err}

Error message

Error parsing Inspector configuration. ${err}

What it means

When `{% put %}` is used without `=` (capture mode), the tag body between `{% put %}` and `{% endput %}` is captured into exactly one target name. PutTokenParser throws this SyntaxError when parseAssignmentExpression returns more than one name in capture mode, because there is no way to split one rendered body across several variables.

Source

Thrown at modules/backend/assets/foundation/controls/inspector/inspector.datainteraction.js:143

            $.oc.stripeLoadIndicator.hide();
        });
    }

    //
    // Internal methods
    //

    DataInteraction.prototype.parseConfiguration = function(configuration) {
        if (!Array.isArray(configuration) && !$.isPlainObject(configuration)) {
            if ($.trim(configuration) === 0) {
                return {};
            }

            try {
               return JSON.parse(configuration);
            }
            catch(err) {
                throw new Error('Error parsing Inspector configuration. ' + err);
            }
        }
        else {
            return configuration;
        }
    }

    DataInteraction.prototype.configurationRequestDone = function(data, onComplete, result) {
        result.configuration = this.parseConfiguration(data.configuration.properties);

        if (data.configuration.title !== undefined) {
            result.title = data.configuration.title;
        }

        if (data.configuration.description !== undefined) {
            result.description = data.configuration.description;
        }

View on GitHub (pinned to b608633a7e)

Solutions

  1. Use one `{% put name %}...{% endput %}` block per target variable.
  2. If you have multiple values up front, keep direct-assignment mode: `{% put header, footer = h, f %}`.
  3. Compute the second value inside the body and assign it separately with `{% put other = expr %}`.

Example fix

// before
{% put header, footer %}<h1>Hi</h1>{% endput %}

// after
{% put header %}<h1>Hi</h1>{% endput %}
{% put footer %}<small>Bye</small>{% endput %}
Defensive patterns

Strategy: try-catch

Validate before calling

// Lint: capture-mode {% put %} must have exactly one target name
if (preg_match_all('/{%-?\s*put\s+([a-zA-Z_][\w]*)\s*,[^=]*%-?}(?!.*=)/s', $template, $m)) {
    // a comma after the first name in a tag without `=` is capture mode with multiple targets
    throw new RuntimeException('Multiple put targets in block mode');
}

Try / catch

try {
    $twig->load($template);
} catch (Twig\Error\SyntaxError $e) {
    if (str_contains($e->getMessage(), 'cannot have multiple targets')) {
        // split the block into one {% put %} per target
    }
}

Prevention

When it happens

Trigger: Writing `{% put header, footer %} ... {% endput %}` — any comma-separated list of targets before `{% endput %}` triggers it at compile time.

Common situations: Trying to fill two placeholders from one block; refactoring a `{% put a, b = x, y %}` assignment into capture form and leaving the comma; misunderstanding the tag as a multi-placeholder setter.

Related errors


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