chore: force Vercel cache rebuild#256
Conversation
Build was failing due to Next.js cache corruption. This commit forces Vercel to rebuild with fresh cache. Issue: TypeScript errors on valid imports (logWarn) Root cause: Stale .next cache Local fix: rm -rf .next && bun run build (works in 42s) Vercel fix: This commit triggers fresh build Expected result: Build should complete in ~2-3 minutes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR attempts to fix Vercel build failures caused by Next.js cache corruption by adding a cache-bust documentation file. The logWarn import error was caused by stale .next cache even though the code exists.
Key Issue Found:
- Simply committing a new file does not invalidate Vercel's
.nextbuild cache. Vercel caches the.next/directory between deployments based on source code changes, not the addition of unrelated documentation files.
More Effective Solutions:
- Set
VERCEL_FORCE_NO_BUILD_CACHE=1environment variable (temporary) - Modify
next.config.jswith configuration changes - Clear cache manually via Vercel Dashboard → Settings → Caching
- Touch/modify an actual build config file that Vercel watches
Confidence Score: 2/5
- This PR is safe to merge but unlikely to solve the build cache issue
- The approach of adding a documentation file will not invalidate Vercel's
.nextbuild cache. Vercel caches the build output directory between deployments, and adding unrelated files doesn't trigger cache invalidation. The build will likely fail again with the samelogWarnerror. A score of 2/5 reflects that while this won't break anything (safe), it won't fix the problem either (ineffective). - The
.vercel-cache-bustfile needs to be replaced with an actual cache-invalidation strategy (environment variable, config change, or manual dashboard action)
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/web/.vercel-cache-bust | 3/5 | Added cache-bust documentation file to force Vercel rebuild; approach may not actually invalidate build cache |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Git as Git Repository
participant GH as GitHub
participant Vercel as Vercel Build System
participant Cache as Build Cache (.next/)
Dev->>Git: git commit (add .vercel-cache-bust)
Dev->>GH: git push
GH->>Vercel: Trigger build webhook
Vercel->>Cache: Check for existing .next cache
Cache-->>Vercel: Return cached .next directory
Note over Vercel,Cache: ⚠️ New file doesn't invalidate cache
Vercel->>Vercel: Build with cached .next/
Note over Vercel: Build likely fails with same<br/>logWarn error from stale cache
Vercel-->>GH: Build status (likely failure)
1 file reviewed, 1 comment
| # Vercel Cache Bust | ||
|
|
||
| This file forces Vercel to rebuild with a fresh cache. | ||
|
|
||
| Build timestamp: 2025-11-08T02:10:00Z | ||
| Reason: Fix build cache corruption issue |
There was a problem hiding this comment.
logic: Simply adding a new file may not invalidate Vercel's .next build cache. Vercel caches the .next/ directory between builds, and adding unrelated files typically doesn't trigger cache invalidation.
Consider these more reliable approaches:
- Add
VERCEL_FORCE_NO_BUILD_CACHE=1environment variable in Vercel dashboard (temporary) - Modify
next.config.jswith a build ID or cache invalidation - Use Vercel CLI:
vercel build --force - Clear cache via Vercel dashboard: Settings → Caching → Clear Build Cache
Score: 4/5 - High confidence this won't work as intended. The build will run, but likely reuse the corrupted .next cache.
Problem
Vercel builds were failing due to Next.js cache corruption:
Even though the import exists in
logger-server.ts, stale.nextcache was causing TypeScript to fail.Solution
This PR forces Vercel to rebuild with a fresh cache by adding a cache-bust file.
Local Verification
✅
rm -rf .next && bun run buildworks perfectly in 42 secondsExpected Result
This should trigger a fresh Vercel build that completes in ~2-3 minutes.
Will merge immediately to trigger rebuild.