Concurrent first runs of `vp config` in linked worktrees fail with "could not lock config file"
Maintainers usually reply within 1 day
@naokihaba is already working on this.
Since Oct 9, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
This is a follow-up to #2849.
While prevents vp config from rewriting git config values that are already up to date, the very first run in a fresh clone still has to write them because core.hooksPath, vp.hooks.dir, and vp.hooks.prefix are not set yet.
Linked worktrees share the same .git/config file. Because git fails immediately instead of waiting when config.lock exists, running the initial vp config concurrently across multiple worktrees causes write collisions:
error: could not lock config file /path/to/repo/.git/config: File exists
The command then exits with code 1. If this runs inside a prepare script, the package manager treats it as a lifecycle script failure and aborts the install.
We run into this when setting up multiple worktrees in parallel right after cloning, before any single worktree finishes its setup. Once one command succeeds, subsequent runs simply skip writing and never fail.
Reproduction
https://github.com/naokihaba/vite-plus-config-first-run-lock-repro
Steps to reproduce
No response
System Info
1. Clone the reproduction repository and install the dependencies.
git clone https://github.com/naokihaba/vite-plus-config-first-run-lock-repro
cd vite-plus-config-first-run-lock-repro
pnpm install --ignore-scripts
2. Run the reproduction with two worktrees.
pnpm repro
3. You can also run it with four worktrees or use the global CLI if needed.
REPRO_WORKTREES=4 REPRO_ROUNDS=15 bash reproduce.sh
bash reproduce.sh --global
In each round, the script creates a fresh repository with linked worktrees and runs `vp config --no-agent` across all of them at once, so every command acts as a first run.
If at least one lock failure occurs, the script prints a summary and exits with code 0.
Used Package Manager
pnpm
Logs
$ vp env current
Node.js:
Version 24.21.0
Source lts
Bin Path /Users/naokihaba/.vite-plus/js_runtime/node/24.21.0/bin/node
Installed true
Mode managed
Package Manager:
Name pnpm
Version 12.10.1
Source lockfile or config
Bin Paths
pnpm /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpm
pnpx /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpx
Installed false
Mode managed
$ vp --version
vp v1.0.0
Local vite-plus:
vite-plus v1.0.0
Tools:
vite v8.3.1
rolldown v1.2.11
vitest v5.0.1
oxfmt v0.70.0
oxlint v1.85.0
oxlint-tsgolint v7.0.2003
tsdown v0.23.0
Environment:
Package manager pnpm default
Node.js v24.21.0
# Additional
git version 2.55.0
macOS 27.0 (arm64)
Node.js v24.20.0 from PATH for the local-mode runs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- Dominant language
- Rust
- Stars
- 6k
- Forks
- 274
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 195
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from voidzero-dev/vite-plus
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package managerPossibly taken @Crimson341 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
voidzero-dev/vite-plus#2970 ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
voidzero-dev/vite-plus#2882 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
voidzero-dev/vite-plus#2097 · 10 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Windows: PowerShell installer (1.1.0) does not add vite-plus\bin to user PATH — 'vp' not recognizedOpen
Difficulty 4/5 3-5 days Newbie friendliness 30/100
voidzero-dev/vite-plus#2984 · 1 comment ·
Maintainers usually reply within 1 day
-
pending triage
Difficulty 3/5 1-2 days Newbie friendliness 40/100
voidzero-dev/vite-plus#2983 ·
Maintainers usually reply within 1 day
All issues in voidzero-dev/vite-plus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
swc-project/swc#12516 ·
Maintainers usually reply within 1 day
-
app bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security updatePossibly taken @muscariello claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)Possibly taken @muse-yamaa-bot claimed this today. Openwork-item
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day