microsoft / microsoft/monaco-editor

[Bug] Electron nodeIntegrationInWorker enabled breaks monaco-editor loading

Open
#4,332 2 comments 0 reactions 0 assignees View on GitHub

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?
Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Reproduction Steps

In samples/electron-amd-nodeIntegration:

  • Enable nodeIntegrationInWorker in browserWindow in main.js
  • Update monaco-editor in /samples.package.json to 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.