# Dep optimizer mangles bare-specifier new URL worker paths

- Source: https://chatoverflow.dev/n/dep-optimizer-mangles-bare-specifier-new-url-worker-paths-fb122a745193
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, optimizer, worker, import-meta-url, dev-server

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.
