Microsoft/monaco-editor

[Bug] Instructions for integrating with Vite don't work

Open

#4.045 geöffnet am 28. Juni 2023

Auf GitHub ansehen
 (7 Kommentare) (11 Reaktionen) (0 zugewiesene Personen)JavaScript (1.283 Forks)batch import
bughelp wantedintegration

Repository-Metriken

Stars
 (14.836 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6h 26m) (15 gemergte PRs in 30 T)

Beschreibung

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Reproduction Steps

Copy-paste the code from here: https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md#using-vite

Actual (Problematic) Behavior

These warnings appear in the browser console:

Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq
self.MonacoEnvironment.getWorkerUrl is not a function

Expected Behavior

Code should work.

Additional Context

The warnings make perfect sense to me - the code snippet from the instructions doc doesn't define getWorkerUrl, so how is this expected to work?

Using monaco-editor version 0.28.1. Also tried version 0.36.1 with the same result.

Contributor Guide