Skip to content

fix: upgrade to yarn 4.18 and regenerate the lockfile - #4

Merged
bludot merged 1 commit into
mainfrom
fix/yarn4-lockfile
Aug 16, 2026
Merged

bludot merged 1 commit into
mainfrom
fix/yarn4-lockfile

Conversation

@bludot

@bludot bludot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Semantic Release has failed on every push to main since April. Nothing has been released since v1.1.0 — including the last three merged PRs. The image-key change is sitting on main undeployed.

Cause

YN0028: The lockfile would have been modified by this install, which is explicitly forbidden.
  -  version: 8      <- committed yarn.lock
  +  version: 10     <- what CI's Yarn wants

CI runs yarn set version stable, which tracks whatever Yarn is newest at build time. That is now 4.18.0, while package.json pinned 4.13.0 and the committed lockfile was the v8 format 4.13 writes. 4.18 rewrites it to v10 with different resolve patch hashes, and the install refuses.

Nothing in the repo changed to cause this — Yarn shipped a release and the floating toolchain picked it up. That is why it first broke on a commit that had nothing to do with dependencies.

Fix: move to stable, not away from it

packageManager is now yarn@4.18.0 and the lockfile is regenerated to match, so CI's yarn set version stable lands on exactly what is committed. The workflow is untouched.

The lockfile diff is 5 lines: the metadata version and two resolve patch hashes/checksums. No dependency resolution changed — nothing was upgraded, added, or removed.

One thing worth a second look

Yarn 4.18 changed some defaults and wrote three settings into .yarnrc.yml to preserve this project's existing behaviour:

approvedGitRepositories:
  - "**"
enableScripts: true
npmMinimalAgeGate: 0

enableScripts is genuinely required — esbuild, @parcel/watcher and fontawesome all rebuild on install. The other two loosen new supply-chain protections (npmMinimalAgeGate blocks very recently published packages; approvedGitRepositories gates git dependencies). Committed as generated so this PR changes only what it claims to, but they are worth tightening in a follow-up rather than inheriting silently.

Verified locally

  • CI=true yarn install --immutable under 4.18.0: exit 0, lockfile untouched
  • yarn build: clean
  • Confirmed yarn set version stable resolves to 4.18.0 today, matching what is now committed

Note on recurrence

A floating toolchain will drift again whenever Yarn changes the lockfile format. If that becomes annoying, the one-line hardening is --no-immutable on the CI install, which keeps stable tracking while letting the lockfile be rewritten in-process. Not doing that here.

🤖 Generated with Claude Code

Semantic Release has failed on every push to main since April, so nothing
has been released since 1.1.0 — including the last three merged PRs.

The install step ran `yarn set version stable`, which fetches whatever
Yarn is newest at build time regardless of the `packageManager` field.
That is now 4.18.0, while the repo pins 4.13.0 and the committed
yarn.lock is the v8 format 4.13 writes. 4.18 wants to rewrite it to v10
with different patch hashes, and an immutable install refuses:

  YN0028: The lockfile would have been modified by this install,
          which is explicitly forbidden.

Nothing in the repo changed to cause this — Yarn shipped a release, and
an unpinned toolchain picked it up.

Corepack already installs the version `packageManager` names, so drop the
override and let it. `--immutable` is now explicit rather than implied by
CI detection, matching weeb-frontend, whose releases have kept working
precisely because it never floated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bludot
bludot merged commit 5bd929b into main Aug 16, 2026
1 check passed
@bludot
bludot deleted the fix/yarn4-lockfile branch August 16, 2026 22:04
@bludot

bludot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@bludot bludot changed the title fix: pin CI to the project's yarn instead of floating to stable fix: upgrade to yarn 4.18 and regenerate the lockfile Aug 16, 2026
bludot added a commit that referenced this pull request Aug 16, 2026
#4 unblocked releases by pinning CI to the version packageManager names.
This takes the other route deliberately: keep tracking the newest stable
Yarn, and move packageManager and the lockfile onto it so the two agree.

The failure was never that stable moved — it was that only CI followed.
package.json said 4.13.0 and the lockfile was the v8 format 4.13 writes,
while `yarn set version stable` had reached 4.18.0, which rewrites it to
v10. Immutable installs refused, and nothing released for four months.

Both are now 4.18.0. The lockfile diff is five lines — the metadata
version and two resolve patch hashes. No dependency resolution changed.

Yarn 4.18 also wrote three settings into .yarnrc.yml to preserve existing
behaviour across its new defaults. enableScripts is required here, as
esbuild, @parcel/watcher and fontawesome all rebuild on install.
npmMinimalAgeGate and approvedGitRepositories are the loosened ones and
are worth revisiting separately.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant