-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)pending triage
Description
Describe the bug
After the latest vitest version, PR #9626 is creating regression issue.
Causing the error:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
SystemError: Invalid src or dest: cp returned EINVAL (src and dest cannot be the same) melroy/my-project/apps/backend/test-report/coverage
❯ checkPaths node:internal/fs/cp/cp:80:13
❯ cpFn node:internal/fs/cp/cp:66:17
❯ HTMLReporter.onFinishedReportCoverage ../../node_modules/.pnpm/@vitest+ui@4.1.0_vitest@4.1.0/node_modules/@vitest/ui/dist/reporter.js:175:4
❯ Vitest.reportCoverage ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cli-api.DuT9iuvY.js:13755:146
❯ ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cli-api.DuT9iuvY.js:13459:6
❯ ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cli-api.DuT9iuvY.js:13468:11
❯ ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cli-api.DuT9iuvY.js:13338:19
❯ startVitest ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cli-api.DuT9iuvY.js:14380:8
❯ start ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cac.CWGDZnXT.js:2316:15
❯ CAC.run ../../node_modules/.pnpm/vitest@4.1.0_@types+node@24.12.0_@vitest+ui@4.1.0_jsdom@27.4.0_vite@7.3.1_@types+node@2_08ea2c2d9096821c90d54ab0e58e7b62/node_modules/vitest/dist/chunks/cac.CWGDZnXT.js:2294:2
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_FS_CP_EINVAL', info: { message: 'src and dest cannot be the same', path: 'melroy/my-project/apps/backend/test-report/coverage', syscall: 'cp', errno: 22, code: 'EINVAL' }, errno: 22, syscall: 'cp', path: 'melroy/my-project/apps/backend/test-report/coverage' }
Reproduction
See link: https://stackblitz.com/edit/vitest-dev-vitest-evwaapxo
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
include: ['tests/**/*.test.ts'],
exclude: ['**node_modules/**', '**.git/**', 'dist', 'build'],
globals: true,
reporters: ['default', 'junit', 'html'],
coverage: {
enabled: true,
provider: 'v8',
reporter: ['text', 'text-summary', 'html'],
reportsDirectory: './same-directory/coverage',
include: ['src/**/*.ts']
},
outputFile: {
junit: './same-directory/junit.xml',
html: './same-directory/index.html'
},
environment: 'node',
bail: 2,
clearMocks: true
}
})System Info
System:
OS: Linux 6.17 Linux Mint 22.3 (Zena)
CPU: (48) x64 AMD Ryzen Threadripper 7960X 24-Cores (NICE, huh?)
Memory: 107.33 GB / 125.30 GB (NICE, huh?)
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 24.13.1 - /home/melroy/.nvm/versions/node/v24.13.1/bin/node
npm: 11.8.0 - /home/melroy/.nvm/versions/node/v24.13.1/bin/npm
pnpm: 10.32.1 - /home/melroy/.local/share/pnpm/pnpm
bun: 1.2.2 - /home/melroy/.bun/bin/bun
Deno: 2.5.4 - /home/melroy/.deno/bin/deno
Browsers:
Chrome: 146.0.7680.80
Chromium: 146.0.7680.71
Firefox: 148.0.2
Firefox Developer Edition: 148.0.2
npmPackages:
@vitest/coverage-v8: ^4.1.0 => 4.1.0
@vitest/ui: ^4.1.0 => 4.1.0
vitest: ^4.1.0 => 4.1.0Used Package Manager
npm
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.
- 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
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)pending triage