UI: Fix Monaco workers crashing in production mode (#67546)
`?url` does not run the Vite worker pipeline. For `editor.worker.js` it inlines the raw source as a base64 data URL (the source is below the default `assetsInlineLimit`), and the inlined module still has bare specifier imports it cannot resolve in a Worker context. For `json.worker.js` it copies a partly-bundled file whose top-level `import '../../editor/editor.worker.js'` resolves to a path that does not exist in the build output. Both cases manifest at runtime as "Could not create web worker(s). Falling back to loading web worker code in main thread" followed by a stream of fallback fetch errors. Switch to `?worker&url`: Vite runs the file through the worker pipeline (bundling all dependencies into a self-contained IIFE) and the URL query suffix returns the resulting URL as a string instead of a Worker constructor. The Blob shim from #67352 then imports a properly bundled worker, restoring real worker-thread execution. Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
P
Pierre Jeambrun committed
021606f0837069da5e6674ca55b3531b77abb8be
Parent: eff567c
Committed by GitHub <noreply@github.com>
on 5/26/2026, 1:57:01 PM
No diff available for this commit.