microsoft / microsoft/monaco-editor
[Bug] Electron nodeIntegrationInWorker enabled breaks monaco-editor loading
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
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
Reproduction Steps
In samples/electron-amd-nodeIntegration:
- Enable
nodeIntegrationInWorkerinbrowserWindowinmain.js - Update
monaco-editorin/samples.package.jsonto latest - See the when starting the application you will get the following console errors in the chrome devtools
The factory function of "vs/language/typescript/tsWorker" has thrown an exception
TypeError: d0 is not a function
Actual (Problematic) Behavior
Monaco-editor will render but not work as expected since the types are no longer visible on hover
Expected Behavior
It should load without errors as with version 0.36.1
Additional Context
The problem is visible from version 0.37.0 onwards. From some debug I've already done, I think I might've narrowed it to the typescript 5 update and this change in detecting the isNodeLikeSystem
https://github.com/microsoft/TypeScript/commit/dc92488da8de8ca204000ff5019f4c35915a5e37
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 in samples/electron-amd-nodeIntegration/main.js and samples.package.json, enable nodeIntegrationInWorker, and update monaco-editor to the latest version. Compare the startup console errors with version 0.36.1 and investigate the referenced TypeScript isNodeLikeSystem change; done means the sample loads without errors and types appear on hover.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript, typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100