forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
bug: upstreamBug in a dependency of ViteBug in a dependency of Vite
Description
Describe the bug
The following was fine with regular rollup Vite, but now is incorrect:
enum NumberEnum {
NUM_1 = 1000,
NUM_2 = 2000,
NUM_3 = 3000,
NUM_4 = 4000,
}
enum ComputedEnum {
COMPUTED_1 = `${NumberEnum.NUM_1}-${NumberEnum.NUM_2}`,
COMPUTED_2 = `${NumberEnum.NUM_3}-${NumberEnum.NUM_4}`,
}With Vite (previous, good): ComputedEnum.COMPUTED_1 is "1000-2000"
With Vite-Rolldown (not good): ComputedEnum.COMPUTED_1 is "-"
If I change the first enum to strings instead of numbers, the computed value is correct.
Computed values from numbers that don't use templates, are also good. It seems the problem arises from using a number in a string template.
Reproduction
https://stackblitz.com/edit/vitejs-rolldown-vite-xygdc9pb?file=src%2Fenums.spec.ts&view=editor
Steps to reproduce
See test example in reproduction link.
System Info
System:
OS: Windows 11 10.0.26200
CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12950HX
Memory: 4.91 GB / 31.69 GB
Binaries:
Node: 22.18.0 - C:\Users\X\AppData\Roaming\nvm4w\nodejs\node.EXE
Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 10.9.3 - C:\Users\X\AppData\Roaming\nvm4w\nodejs\npm.CMD
Browsers:
Chrome: 141.0.7390.125
Edge: Chromium (140.0.3485.54)
Internet Explorer: 11.0.26100.1882Used Package Manager
yarn
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.
Metadata
Metadata
Assignees
Labels
bug: upstreamBug in a dependency of ViteBug in a dependency of Vite