[Bug] Diff demo doesn't work on the project homepage
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?
- [x] Not 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
Monaco Editor Playground Code
Reproduction Steps
No response
Actual (Problematic) Behavior
No response
Expected Behavior
No response
Additional Context
No response
We've had problems with 0.52's diff views in our project; are diffs broken across the board?
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.
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.
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.
I can confirm that problem is with CDN without CDN works as expected ...