microsoft / microsoft/monaco-editor

[Bug] Update to angular 18.2.3 gives importScripts error

Open
#4,675 10 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Have the following dependencies:
"@angular/core": "18.2.3"
"monaco-editor": "^0.51.0"
"typescript": "^5.5.4"

Run npm install.

Import a monaco editor in to your project and add it to your dom:

Actual (Problematic) Behavior

e7ea2d78-e839-48eb-963c-a52acac188d7:1 Uncaught SyntaxError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL 'assets/monaco-editor/min/vs/base/worker/workerMain.js#editorWorkerService' is invalid.
at e7ea2d78-e839-48eb-9…-a52acac188d7:1:337

Uncaught DOMException SyntaxError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL 'assets/monaco-editor/min/vs/base/worker/workerMain.js#editorWorkerService' is invalid.
at

image
Expected Behavior

No errors.

Additional Context

No response

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

Reproduce the issue with Angular 18.2.3, monaco-editor 0.51.0, and TypeScript 5.5.4 using the ngx-monaco-editor element. Start by examining how the asset path for assets/monaco-editor/min/vs/base/worker/workerMain.js is resolved and loaded; done means the editor loads without the importScripts URL error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.