microsoft / microsoft/monaco-editor

[Bug] Loading files from local server causes a bug when typing

Open
#4,723 0 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

No response

Actual (Problematic) Behavior

Text randomly gets appended or dissapears
(Shown using local files)
https://github.com/user-attachments/assets/94b76cff-4e74-44cd-bb76-b1c715fb5eae
Logs also return 'undefined'

Expected Behavior

Typing works normally without any anomalies
https://github.com/user-attachments/assets/e1c9688b-22b9-4703-9592-bcc12a8ddf86

Additional Context

Use local files instead of the unpkg links in your html file
Example

<script src="editor/codeEditors/monaco/loader.js"></script>
<script src="editor/codeEditors/monaco/mainnls.js"></script>
<script src="editor/codeEditors/monaco/main.js"></script>

When I use the default unpkg files the editor works fine

<script src="https://unpkg.com/monaco-editor@0.34.0/min/vs/loader.js"></script>
<script src="https://unpkg.com/monaco-editor@0.34.0/min/vs/editor/editor.main.nls.js"></script>
<script src="https://unpkg.com/monaco-editor@0.34.0/min/vs/editor/editor.main.js"></script>

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 by reproducing the issue with the local editor/codeEditors/monaco/loader.js, mainnls.js, and main.js files, then compare it with the corresponding unpkg Monaco 0.34.0 files. Check the browser behavior and logs while typing; done means local files no longer append or lose text and typing matches the unpkg setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.