-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Labels
feat: web workersp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
This used to build successfully in version 6.0.11. Started failing in 6.1.0.
Code:
const worker = new Worker(new URL('./worker', import.meta.url));Build:
vite build
β 30 modules transformed.
x Build failed in 136ms
error during build:
[vite:worker-import-meta-url] Expected ',', got ':'
file: /home/nonroot/app/browser/src/worker/singleton.ts
at getRollupError (file:///home/nonroot/app/browser/node_modules/rollup/dist/es/shared/parseAst.js:397:41)
at convertProgram (file:///home/nonroot/app/browser/node_modules/rollup/dist/es/shared/parseAst.js:1085:26)
at parseAstAsync (file:///home/nonroot/app/browser/node_modules/rollup/dist/es/shared/parseAst.js:2071:106)
at async parseWorkerOptions (file:///home/nonroot/app/browser/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:46636:23)
at async getWorkerType (file:///home/nonroot/app/browser/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:46675:22)
at async Object.transform (file:///home/nonroot/app/browser/node_modules/vite/dist/node/chunks/dep-CfG9u7Cn.js:46721:30)
at async transform (file:///home/nonroot/app/browser/node_modules/rollup/dist/es/shared/node-entry.js:20689:16)
at async ModuleLoader.addModuleSource (file:///home/nonroot/app/browser/node_modules/rollup/dist/es/shared/node-entry.js:20902:36)Reproduction
Please see code below
Steps to reproduce
Code:
const worker = new Worker(new URL('./worker', import.meta.url));Build:
vite buildSystem Info
System:
OS: Linux 6.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (10) arm64 unknown
Memory: 6.23 GB / 7.65 GB
Container: Yes
Shell: 5.1.4 - /bin/bash
Binaries:
Node: 20.13.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.1 - /usr/local/bin/npm
npmPackages:
vite: ^6.1.0 => 6.1.0Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: web workersp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release