Microsoft/monaco-editor

[Bug] Cannot load `monaco-editor` esm module within Deno for bundling to the client.

Open

#3,501 建立於 2023年1月9日

在 GitHub 查看
 (3 留言) (2 反應) (0 負責人)JavaScript (1,283 fork)batch import
feature-requesthelp 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?

Reproduction Steps

Can be reproduced by following the instructions on this example repo.

https://github.com/cowboyd/monaco-fresh#static-import

Actual (Problematic) Behavior

Just loading the monaco-editor module (not using it) fails because of this code https://github.com/microsoft/vscode/blob/12e6b0b3043f19d0cf1730eb3c213d3930310053/src/vs/base/browser/canIUse.ts#L21-L23

It appears that there has is specific carve out so that the code will run on NodeJS with the check for platform.isNative, but platform.isNative is false when running on Deno.

Expected Behavior

The ES module should be loaded successfully, even though you never call editor.create().

貢獻者指南