Open
Description
Describe the bug
The generated worker file contains es syntax
export function __vite_legacy_guard()
Cannot be used normally in worker
Reproduction
https://stackblitz.com/edit/vitejs-vite-ixsfq5p1?file=main.js
Steps to reproduce
1.npm install
2.npm run build
System Info
System:
OS: Windows 10 10.0.19042
CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
Memory: 3.29 GB / 15.95 GB
Binaries:
Node: 20.11.0 - E:\Program Files\nodejs\node.EXE
npm: 10.2.4 - E:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (127.0.2651.74)
Internet Explorer: 11.0.19041.1566
npmPackages:
@vitejs/plugin-legacy: ^6.0.0 => 6.0.0
@vitejs/plugin-react: ^4.3.4 => 4.3.4
vite: ^6.0.3 => 6.0.3
Used 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.