Closed pgrones closed 2 months ago
Hello @pgrones. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction
will be closed if they have no activity within 3 days.
Without being able to reproduce this issue there is nothing we can do. Everything looks fine in your linked configuration files.
Though I would recommend to make sure your project has pnpm-lock.yaml
committed to git, and that CI is using it correctly.
I figured it was a long shot without being reproducable, but we were starting to run out of ideas.
Looking at the lock file might be a good hint. Any recommendations on what flags to include? We always commit the lock file and are using the following command:
pnpm i --prefer-offline --frozen-lockfile
If you don't think this is an issue with vitest anyways, then you can close the issue. Thank you for taking the time to answer!
The error message here is quite cryptic but it might be good starting point to check that lock file doesn't have multiple different versions of Vitest packages used. Using --frozen-lockfile
and checking that CI install everything without any warnings is good point too.
I'm having this problem too. One thing I've found is that downgrading pnpm to version 8 solves it.
That doesn't seem to work for us. When downgrading to pnpm 8.15.9, the command just fails silently. Even using pnpm 8 locally and committing the lock file doesn't seem to help.
When connecting directly to the pipeline runner and executing vitest watch
, the error now complains about not finding react-router-dom
.
Something seems to be seriously wrong with pnpm for this project. The build with vite
works fine though, so it's some weird combination of pnpm and vitest that causes the issue
Figured it out. We're using Windows and the path pnpm generates is longer than the limit imposed by Windows.
The command only works locally, because the project isn't as deeply nested as it is on the runner.
Took a few hours of testing until we finally figured this out, but I'm glad it's not actually an issue with pnpm or vitest.
Describe the bug
I'm not sure whether this is an issue with vitest or with pnpm.
When running tests with coverage locally, everything seems to work fine. When running the same command in a CI environment however, the execution fails, printing the following error message.
What's strange is that this doesn't seem to happen for every project. One of our other projects has virtually the same setup and config files and runs without any issues.
For completeness, here are all the other files that might produce the issue:
package.json
vite.config.ts
tsconfig.json
Reproduction
Not possible without a CI environment
System Info
Used Package Manager
pnpm
Validations