monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] Diff demo doesn't work on the project homepage

Open sdzialowski-godaddy opened this issue 1 year ago • 5 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [x] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Simple one. Please fix "diff" demo on the homepage: https://microsoft.github.io/monaco-editor/#:~:text=Side%20by%20side%20live%20comparison

Image

Monaco Editor Playground Code


Reproduction Steps

No response

Actual (Problematic) Behavior

No response

Expected Behavior

No response

Additional Context

No response

sdzialowski-godaddy avatar Jan 20 '25 15:01 sdzialowski-godaddy

We've had problems with 0.52's diff views in our project; are diffs broken across the board?

mattgodbolt avatar Apr 15 '25 15:04 mattgodbolt

Not sure, I haven't encounter issue with diff in VSCode, just in the homepage of the editor: https://microsoft.github.io/monaco-editor/#:~:text=Side%20by%20side%20live%20comparison. That is kinda bad that page presenting capabilities of the tool doesn't work :) Probably worth looking into.

sdzialowski-godaddy avatar Apr 15 '25 16:04 sdzialowski-godaddy

It seems linked to #4837 where things like:

simpleWorker.js:27 Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq
u @ simpleWorker.js:27
(anonymous) @ defaultWorkerFactory.js:186Understand this warning
simpleWorker.js:29 Uncaught TypeError: Failed to execute 'importScripts' on 'WorkerGlobalScope': Module scripts don't support importScripts().
u @ simpleWorker.js:29
(anonymous) @ defaultWorkerFactory.js:186Understand this warning
8beb57e2-dd23-4bf5-97c0-918238c44309:1 Uncaught TypeError: Failed to execute 'importScripts' on 'WorkerGlobalScope': Module scripts don't support importScripts().
    at 8beb57e2-dd23-4bf5-97c0-918238c44309:1:24

get logged.

From locally experimenting I discovered I only see this if I serve my content from a CDN. I'm using webpack and according to the help I should be able to set publicPath to make this work, but it still doesn't.

This was working in v0.49, which is the last version we could update to.

mattgodbolt avatar Apr 15 '25 17:04 mattgodbolt

Definitely not broken across the board. I think you're right to be narrowing it down to something related to the packaging/distribution setup you're using. On my end, I use Vite and npm (no CDN) and it works as expected in v0.52.2.

DavidSeptimus avatar Apr 15 '25 18:04 DavidSeptimus

I can confirm that problem is with CDN without CDN works as expected ...

ivanmjartan avatar May 13 '25 09:05 ivanmjartan