vitest-dev / vitest-dev/vitest

`ENAMETOOLONG` error with a long file path when `server.debug.dump` flag is on

Open
#7,744 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

p3-minor-bug
Dominant language
TypeScript
Stars
17.1k
Forks
2k
Avg merge
1d 22h
Merged PRs (30d)
94

Description

Describe the bug

it happens when a test case file has a long path

the error message is like:

 FAIL  App.very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_long.spec.tsx [ App.very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_long.spec.tsx ]
Error: ENAMETOOLONG: name too long, open '/xxx/reproductions/.vite-node/dump/_Volumes_jinjiang-portable-disk_Developer_personal_reproductions_App_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_very_long_spec_tsx--51554923.js'

Original discussion: https://github.com/vitest-dev/vitest/discussions/7662

Reproduction

https://github.com/Jinjiang/reproductions/tree/vitest-dump-20250327

System Info
System:
    OS: macOS 15.4
    CPU: (8) arm64 Apple M1
    Memory: 182.92 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.local/share/mise/installs/node/22/bin/node
    Yarn: 1.22.18 - ~/.yarn/bin/yarn
    npm: 10.9.2 - ~/.local/share/mise/installs/node/22/bin/npm
    pnpm: 10.6.5 - ~/Library/pnpm/pnpm
    bun: 1.1.36 - ~/.local/share/mise/installs/bun/latest/bin/bun
  Browsers:
    Safari: 18.4
  npmPackages:
    @vitejs/plugin-react: ^4.3.4 => 4.3.4 
    vite: ^6.2.3 => 6.2.3 
    vitest: ^3.0.9 => 3.0.9
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked reproduction with the server.debug.dump flag enabled and a test case file with a long path. Trace the dump behavior that produces the reported ENAMETOOLONG error; done means long test paths no longer fail while debug dump output remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.