Skip to content

ailed to resolve module specifier #1027

@prclin

Description

@prclin

when i use MonacoVscodeApiConfig, error occured:
Failed to resolve module specifier "@codingame/monaco-vscode-api/workers/editor.worker". Relative references must start with either "/", "./", or "../".
Image

it was because of configureDefaultWorkerFactory, more accurately is defineDefaultWorkerLoaders, it loads workers, and

const defaultEditorWorkerService = () => new Worker(
        new URL('@codingame/monaco-vscode-editor-api/esm/vs/editor/editor.worker.js', import.meta.url),
        { type: 'module' }
    );

and in editor.worker.js

export * from '@codingame/monaco-vscode-api/workers/editor.worker'

its content include @codingame/monaco-vscode-api , this is a module name, and worker is load in browser web worker, but browser does not recoginze this, so that this comes run.

i guess this may be the reason

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions