Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#5049·monaco-editor

[Bug] `createWebWorker` is broken in minimal distributions

Author: hainesCreated Oct 13, 2025Updated Aug 27, 2026
Labelsbugeditor-core

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

  • Not reproducible in the monaco editor playground

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

Reproduction Steps

Create a minimal distribution of Monaco Editor (following e.g. https://github.com/microsoft/monaco-editor/tree/main/samples/browser-esm-webpack-small).

Specifically, don't import "monaco", but just import "monaco-editor/esm/vs/editor/editor.api.js" and any features you wish to support.

Actual (Problematic) Behavior

Calling monaco.editor.createWebWorker({ moduleId: "..." }) doesn't work any more due to https://github.com/microsoft/vscode/pull/244117 and https://github.com/microsoft/monaco-editor/pull/4950.

This breaks monaco-yaml: https://github.com/remcohaszing/monaco-yaml/issues/272.

import "monaco" replaces the createWebWorker function with a wrapper that converts the old IWebWorkerOptions to the new IInternalWebWorkerOptions.

However, it's not possible to import this wrapper function without importing the entirety of Monaco Editor because it is bundled into monaco-editor/esm/vs/editor/editor.main.js.

Expected Behavior

It's possible to only import the parts of Monaco Editor that you need and still have a working monaco.editor.createWebWorker function.

Additional Context

No response

Source: microsoft/monaco-editor

View original on GitHubView discussion on GitHub