octobercms/october · error · Error

Unknown label

Error message

Unknown label ${label}

What it means

Worker-resolution failure in the Monaco editor's initEnvironment: Monaco requested a web worker with a label that the getWorker switch does not recognize (only known labels such as 'yaml' and 'editorWorkerService' are mapped). The editor backend cannot decide which worker script to load for that language/service.

Solutions

  1. Use a language/editor service whose worker label is mapped in the switch
  2. Extend the getWorker switch with a case (and worker bundle) for the missing label if that language is genuinely needed
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at modules/backend/vuecomponents/monacoeditor/assets/js/monacoeditor.js:39 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/07125b05a59cdf24. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/vuecomponents/monacoeditor/assets/js/monacoeditor.js:39

                self.MonacoEnvironment = {
                    baseUrl: '${baseUrl}/'
                };
                importScripts('${baseUrl}/vs/base/worker/workerMain.js');
            `],
            { type: 'text/javascript' }
        )
    );

    // window.MonacoEnvironment = { getWorkerUrl: () => proxy };
    window.MonacoEnvironment = {
        getWorker: (moduleId, label) => {
            switch (label) {
                case 'yaml':
                    return new Worker(new URL('monaco-yaml/yaml.worker.min.js', baseUrl));
                case 'editorWorkerService':
                    return new Worker(proxy);
                default:
                    throw new Error(`Unknown label ${label}`);
            }
        }
    };
}

function initEditor(component, options) {
    // Vue 3: Mark model references as raw to prevent Vue from making Monaco objects reactive
    component.modelReferences = Vue.markRaw(component.modelDefinitions.map((def) => {
        return def.makeModelReference(options);
    }));

    if (options.useEmmet && !emmetInitialized) {
        emmetMonaco.emmetHTML(monaco, ["html", "twig", "php"]);
        emmetMonaco.emmetCSS(monaco, ["css", "less", "scss"]);
        emmetInitialized = true;
    }

    if (options.yamlSchemas && !yamlInitialized) {

View on GitHub (pinned to b608633a7e)