microsoft / microsoft/monaco-editor
[Bug] simpleWorker.nls.js fails to load if vs path does not end in 'vs'
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
This configuration will fail to load simpleWorker.nls.js:
<script>
var require = { paths: { vs: 'https://localhost:5001/monaco' } };
</script>
<script src="https://localhost:5001/monaco/loader.js"></script>
<script src="https://localhost:5001/monaco/editor/editor.main.nls.js"></script>
<script src="https://localhost:5001/monaco/editor/editor.main.js"></script>
This code fails to load simpleWorker.nls.js as it tries to load from:
https://localhost:5001/vs/base/common/worker/simpleWorker.nls.js
Note the exclusion of the monaco directory and addition of vs.
However, if the path ends with vs, the simpleWorker loads correctly as shown below:
<script>
var require = { paths: { vs: 'https://localhost:5001/monaco/vs' } };
</script>
<script src="https://localhost:5001/monaco/vs/loader.js"></script>
<script src="https://localhost:5001/monaco/vs/editor/editor.main.nls.js"></script>
<script src="https://localhost:5001/monaco/vs/editor/editor.main.js"></script>
This will load the file from:
https://localhost:5001/monaco/vs/base/common/worker/simpleWorker.nls.js
Actual (Problematic) Behavior
No response
Expected Behavior
No response
Additional Context
No response
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 loader.js entry point and the simpleWorker.nls.js load described in the reproduction steps. Reproduce both path configurations and trace how the configured vs path is resolved. Done means the non-vs-ending path loads simpleWorker.nls.js from the configured Monaco directory rather than from a /vs path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100