This repository was archived by the owner on Mar 19, 2026. It is now read-only.
forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Incorrect new.target.prototype transformation #601
Copy link
Copy link
Description
Describe the bug
In Vite 8.0.0-beta.15, new.target.prototype is incorrectly transformed to _vite_importMeta.prototype in Web Worker contexts, causing a runtime TypeError when the code executes.
Source code:
Object.setPrototypeOf(this, new.target.prototype);Built output (Vite 8 beta.15):
var _vite_importMeta = { url: self.location.href };
// ...
Object.setPrototypeOf(this, _vite_importMeta.prototype); // ❌ _vite_importMeta.prototype is undefined!Reproduction
https://stackblitz.com/edit/ak5xqjbd?file=vite.config.ts,index.html,README.md
Steps to reproduce
npm run build OR npm run preview. Details in README.md
System Info
System: │
│ OS: Windows 11 10.0.26100 │
│ CPU: (22) x64 Intel(R) Core(TM) Ultra 7 165H │
│ Memory: 11.00 GB / 63.46 GB │
│ Binaries: │
│ Node: 24.7.0 - C:\Program Files\nodejs\node.EXE │
│ npm: 11.5.1 - C:\Program Files\nodejs\npm.CMD │
│ pnpm: 10.24.0 - C:\Users\AdamBarclay(Symprex)\AppData\Local\Microsoft\WinGet\Links\pnpm.EXE │
│ bun: 1.3.3 - C:\Users\AdamBarclay(Symprex)\AppData\Local\Microsoft\WinGet\Links\bun.EXE │
│ Browsers: │
│ Chrome: 145.0.7632.116 │
│ Edge: Chromium (140.0.3485.54) │
│ Firefox: 145.0.2 - C:\Program Files\Mozilla Firefox\firefox.exe │
│ Internet Explorer: 11.0.26100.7309 │
│ npmPackages: │
│ vite: 8.0.0-beta.15 => 8.0.0-beta.15Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels