Skip to content

Fix production build failure — every Vercel deployment has been erroring - #28

Merged
crewcricle merged 1 commit into
mainfrom
fix/vercel-production-build
Jul 26, 2026
Merged

Fix production build failure — every Vercel deployment has been erroring#28
crewcricle merged 1 commit into
mainfrom
fix/vercel-production-build

Conversation

@rprabhat

Copy link
Copy Markdown
Collaborator

Summary

Every Vercel deployment for at least the last 23+ hours has failed (Error status on prod and preview alike). Reproduced the failure locally with npm run build (Turbopack dev mode doesn't run the same checks a production build does — type-checking and full module resolution only happen at build time) and worked through the stack of failures one by one:

  1. @crewcircle/knowledge unresolvable — its tsconfig.json had noEmit: true, so the package's own build script exited 0 while emitting nothing but a tsbuildinfo file. Root package.json never built it either. Added a prebuild script and fixed package.json's exports map, whose import conditions pointed at dist/index.mjs — a file the build never actually produced (real output goes to dist/esm/index.js).
  2. Root tsconfig.json typechecked the entire monorepoinclude: ["**/*.ts"] pulled every workspace package's source into the website's own typecheck, so an unrelated missing dependency in packages/observability failed the whole build. Excluded packages/* — each package already has its own tsconfig.json.
  3. Github icon removed from lucide-react — the installed v1.26 dropped brand icons. Swapped for GitFork (the button's label text already says "GitHub").
  4. InternalMemory.create() doesn't existadmin/knowledge/page.tsx called a static factory method that was never part of the class. Fixed to new InternalMemory(...) + .initialize(), matching the actual class API (and its own test file).
  5. DataTable<T> generic not inferred from JSX props — two admin tables passed untyped columns arrays; TypeScript fell back to the base constraint. Added explicit <DataTable<T>> type arguments and the index signatures T extends Record<string, unknown> requires.
  6. Response vs NextResponse — 6 API routes catch the plain Response that requireAdmin() throws and return it directly, typed as NextResponse. Wrapped each in new NextResponse(...).
  7. Stale app dataapps.ts and content.ts's FOOTER_LINKS had regressed to a wrong lineup (missing TaxFlowAI/LocalMate entirely, a fabricated "XeroAssist" entry that was never a real product) — traced via git log -S to a bad merge that clobbered a commit explicitly tagged "Build verified". Restored that verified data, cross-checked against the admin registry's actual provisioned projects (TaxFlowAI, LocalMate, CrewRoster, SmartGL, CardSnap, AuRate).

Test plan

  • rm -rf .next && npm run build — completes cleanly, all 35 routes compiled/prerendered
  • npx tsc --noEmit / npx eslint src --quiet — clean
  • npm run start + curl smoke test: /, /admin, /admin/costs, /admin/observability, /admin/knowledge, /api/admin/health all return 200
  • Vercel preview deployment for this PR

🤖 Generated with Claude Code

Multiple stacked bugs, found by reproducing `npm run build` locally
since Turbopack dev mode doesn't enforce the same checks as a production
build:

- packages/knowledge/tsconfig.json had noEmit:true, so its own `build`
  script never emitted dist/*.js despite exiting 0. Root package.json
  never built it either. Added a root `prebuild` script and fixed the
  package.json exports map (`import` conditions pointed at dist/index.mjs,
  a file the build never produced — corrected to dist/esm/index.js to
  match actual tsc output).
- Root tsconfig.json's `include: ["**/*.ts"]` pulled every workspace
  package's source into the website's own typecheck, so an unrelated
  missing dep in packages/observability failed the whole build. Excluded
  packages/* — each package already has its own tsconfig.
- lucide-react dropped brand icons in the installed v1.26; `Github` no
  longer exists. Swapped for GitFork (label text already says "GitHub").
- admin/knowledge/page.tsx called a static InternalMemory.create() that
  was never part of the class's API — fixed to `new InternalMemory()` +
  `.initialize()`, matching the class's actual constructor/method.
- DataTable<T> generic wasn't inferred correctly from JSX props in two
  admin tables; added explicit `<DataTable<T>>` type arguments and the
  index signatures its `T extends Record<string, unknown>` constraint
  requires.
- API routes catching the plain `Response` requireAdmin() throws and
  returning it directly, typed as NextResponse — wrapped in
  `new NextResponse(...)` across all 6 affected routes.
- apps.ts and content.ts's FOOTER_LINKS had regressed to a stale, wrong
  app lineup (missing TaxFlowAI/LocalMate entirely, a fabricated
  "XeroAssist" entry that was never a real product) from a bad merge —
  confirmed via git history against a commit explicitly tagged "Build
  verified" and cross-checked against the admin registry's actual
  provisioned projects. Restored the correct data.

Verified with a full local `npm run build` (production Turbopack build,
not dev mode) plus a `next start` smoke test of /, /admin, and the other
admin routes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crewcircle-website Ready Ready Preview, Comment Jul 26, 2026 1:18pm

@crewcricle
crewcricle merged commit f79cd4a into main Jul 26, 2026
7 checks passed
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.

2 participants