microsoft / microsoft/monaco-editor
[Bug] Cannot load `monaco-editor` esm module within Deno for bundling to the client.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
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
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().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the static-import reproduction in the linked monaco-fresh example, then inspect src/vs/base/browser/canIUse.ts at the referenced lines and compare the Deno environment with the existing Node.js check. Done means the monaco-editor ES module loads successfully when bundled for the client without calling editor.create().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- deno, javascript
- Domain
- build-system, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100