Microsoft/monaco-editor

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

Open

#4,045 建立於 2023年6月28日

在 GitHub 查看
 (7 留言) (11 反應) (0 負責人)JavaScript (1,283 fork)batch import
bughelp wantedintegration

倉庫指標

Star
 (14,836 star)
PR 合併指標
 (平均合併 6小時 26分鐘) (30 天內合併 15 個 PR)

描述

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.

貢獻者指南