Description
Related plugins
Describe the bug
I upgraded @vitejs/plugin-vue from 5.2.1 to 5.2.2 and now the component ids in my CI are different from the component ids on my machine where the snaps are generated.
In one of my components, in @vitejs/plugin-vue 5.2.1 the component id was data-v-f895525f on both my machine and the CI.
After upgrading to 5.2.2, the the component id on my machine is data-v-7ecf2a22 while in CI it is data-v-33eca55f.
Thus all my tests with snapshots are now failing.
Two questions arise, why have the ids changed at all, and why are they now different on different machines?
Reproduction
n/a
Steps to reproduce
No response
System Info
My machine:
System:
OS: Windows 11 10.0.22631
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13950HX
Memory: 35.40 GB / 63.66 GB
Binaries:
Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
pnpm: 10.6.3 - C:\Program Files\nodejs\pnpm.CMD
Browsers:
Edge: Chromium (133.0.3065.92)
Internet Explorer: 11.0.22621.3527
npmPackages:
@vitejs/plugin-vue: ^5.2.2 => 5.2.2
vite: ^6.2.2 => 6.2.2
CI:
System:
OS: Linux 4.4 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (16) x64 Intel(R) Xeon(R) Platinum 8160 CPU @ 2.10GHz
Memory: 27.74 GB / 31.42 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 22.13.1 - /usr/bin/node
npm: 10.9.2 - /usr/bin/npm
pnpm: 10.2.0 - /usr/bin/pnpm
npmPackages:
@vitejs/plugin-vue: ^5.2.2 => 5.2.2
vite: ^6.2.2 => 6.2.2
Used Package Manager
pnpm
Logs
It is clearly caused by this change #538
The documentation clearly states that componentIdGenerator='filepath'
, which I presume is the default, "hash the file path (relative to the project root)" should use the relative path.
Yet the change clearly uses the relative path only in the componentIdGenerator='function'
case.
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.