Skip to content

5.2.2 breaks CI generated "data-v-..." component ids #547

Closed
@cope

Description

@cope

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

Image

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.

Image

Yet the change clearly uses the relative path only in the componentIdGenerator='function' case.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p4-important ❗Violate documented behavior or significantly improves performance (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions