Skip to content

fix(#720): resolve corrupt package-lock.json (9 stash-conflict blocks) - #721

Merged
admarble merged 1 commit into
mainfrom
fix/corrupt-package-lock-716
Jun 4, 2026
Merged

admarble merged 1 commit into
mainfrom
fix/corrupt-package-lock-716

Conversation

@admarble

@admarble admarble commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Closes #720.

Problem

main's package-lock.json has been invalid JSON since PR #716 (512840f): a git stash pop left 9 unresolved conflict blocks (27 marker lines) that were committed. npm ci from a fresh clone fails.

Found during /release prep for v2.6.2 — the release's pre-flight "clean working tree" check passes because the corruption is committed, not staged, so git status looks clean and the bad file sits at HEAD.

Why it went unnoticed

  • The lockfile isn't published to the npm tarball → npm consumers unaffected.
  • npm install / tsc / vitest tolerate the existing node_modules; only a strict npm ci (fresh clone) parses the lockfile and fails.

Fix

Regenerated via npm install --package-lock-only. npm recomputes the dependency tree deterministically and drops the spurious "dev": true flags on production-reachable transitive deps (cross-spawn, debug, fast-deep-equal, isexe, ms, path-key, shebang-command, +2). Net change: 36 deletions — purely the conflict markers and the stashed-side dev lines.

Verification

  • grep -cE '^(<<<<<<<|=======|>>>>>>>)' package-lock.json → 0
  • node -e "JSON.parse(...)" → valid JSON
  • npm ci --dry-run → parses clean (strict; would fail instantly on markers)
  • npm audit → 0 vulnerabilities

Follow-up (not in this PR)

Add an npm ci-on-fresh-checkout CI gate (or a lockfile-conflict-marker lint) so a corrupt lockfile can't reach main again. Noted in #720.

PR #716 (512840f) committed package-lock.json with 9 unresolved
`git stash` conflict blocks (27 marker lines), leaving the lockfile
as invalid JSON. `npm ci` from a fresh clone fails. npm consumers were
unaffected (the lockfile isn't published) and `npm install`/tsc/vitest
tolerate the existing node_modules, so nothing flagged it — only a
strict `npm ci` parse does.

Regenerated via `npm install --package-lock-only`, which recomputes the
dependency tree and drops the spurious `"dev": true` flags on
production-reachable transitive deps (cross-spawn, debug, fast-deep-equal,
isexe, ms, path-key, shebang-command, +2).

Verified: 0 conflict markers, valid JSON, `npm ci --dry-run` parses clean.
Entire-Checkpoint: e6beafa2df2c
@admarble
admarble merged commit 5d6a63c into main Jun 4, 2026
4 checks passed
@admarble
admarble deleted the fix/corrupt-package-lock-716 branch June 4, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: corrupt package-lock.json on main — 9 unresolved git-stash conflict blocks

1 participant