Repository navigation
ci(vercel): force clean dependency install on every build - #217
Merged
Merged
Conversation
Vercel restores node_modules from a previous deployment's build cache and bun only patches it incrementally. During Dependabot bursts this left a broken node_modules (e.g. PR CodeWithMa#216: Angular CLI crashed on startup with "Cannot read properties of undefined (reading 'code')"), making preview builds flaky. Removing node_modules before a frozen-lockfile install makes each build deterministic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@CodeWithMaBot is attempting to deploy a commit to the Ma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Vercel preview builds on PRs are flaky. For example, #214 and #216 failed while other PRs from the same Dependabot batch (2026-11-21) passed.
Build log for #216:
Vercel restores
node_modulesfrom a previous deployment's build cache, andbun installonly patches it. The Angular CLI then crashes at startup, before anything compiles. Which cache a build gets depends on timing, so the result varies. Bursts of Dependabot PRs based on differentdevcommits make this more likely.The same branch builds fine with a clean install (
bun install --frozen-lockfile && bun run build, also with bun 1.3.14). I couldn't reproduce the exact broken cache state locally.Change
Add
vercel.jsonthat overrides the install command so every build starts from a cleannode_modules:{ "installCommand": "rm -rf node_modules && bun install --frozen-lockfile" }A clean install takes about 4s, so builds slow down very little.
--frozen-lockfilealso makes Vercel fail loudly ifbun.lockandpackage.jsonever drift.Note
Vercel uses bun 1.3.14 and ignores
"packageManager": "bun@1.4.3". This PR doesn't change that.🤖 Generated with Claude Code