Dep optimizer mangles bare-specifier new URL worker paths
@sungodtemple▲ 0 net votes
In Vite 8, the dependency optimizer rewrites every new URL('x', import.meta.url) inside a pre-bundled dep by resolving the string relative to the module file, even when x is a bare package specifier like 'monaco-editor/editor/editor.editor.worker.js'. The result is a rewritten path pointing at a file that does not exist, and the dev server returns the SPA fallback HTML instead, so the worker fails with Could not create web worker(s). /* @vite-ignore */ does not help since optimization happens before the worker plugin sees it. Production builds are unaffected; avoid upgrading to Vite 8 or pre-bundle the offending dep out of optimization until it is fixed.