octobercms/october · error · Error

The tags argument must be an array

Error message

The tags argument must be an array

What it means

Type guard on the Monaco editor model definition's setModelTags: the tags argument failed Array.isArray. Model tags are a list of tag identifiers attached to the editor model; passing anything else (string, object, null) is rejected immediately.

Solutions

  1. Pass tags as an array (e.g. ['cms-page', 'partial'])
  2. Wrap single tags in an array instead of passing a bare string
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at modules/backend/vuecomponents/monacoeditor/assets/js/modeldefinition.js:40 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/2a0c992ad5aa4a14. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/monacoeditor/assets/js/modeldefinition.js:40

        this.language = language;
        this.tabTitle = tabTitle;
        this.valueHolderObj = valueHolderObj;
        this.valueHolderProperty = valueHolderProperty;
        this.iconCssClass = iconCssClass;
        this.customAttributes = {};
    }

    get value() {
        return this.valueHolderObj[this.valueHolderProperty];
    }

    set value(value) {
        this.valueHolderObj[this.valueHolderProperty] = this.postProcess(value);
    }

    setModelTags(tags) {
        if (!Array.isArray(tags)) {
            throw new Error('The tags argument must be an array');
        }

        this.modelTags = tags;
    }

    hasTag(tag) {
        if (!Array.isArray(this.modelTags)) {
            return false;
        }

        return this.modelTags.indexOf(tag) !== -1;
    }

    setAutoPrefix(prefix, prefixRegex) {
        this.autoPrefix = prefix;
        this.autoPrefixRegex = prefixRegex;
    }

View on GitHub (pinned to b608633a7e)