Fix production build failure — every Vercel deployment has been erroring - #28
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Every Vercel deployment for at least the last 23+ hours has failed (
Errorstatus on prod and preview alike). Reproduced the failure locally withnpm 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:@crewcircle/knowledgeunresolvable — itstsconfig.jsonhadnoEmit: true, so the package's ownbuildscript exited 0 while emitting nothing but atsbuildinfofile. Rootpackage.jsonnever built it either. Added aprebuildscript and fixedpackage.json'sexportsmap, whoseimportconditions pointed atdist/index.mjs— a file the build never actually produced (real output goes todist/esm/index.js).tsconfig.jsontypechecked the entire monorepo —include: ["**/*.ts"]pulled every workspace package's source into the website's own typecheck, so an unrelated missing dependency inpackages/observabilityfailed the whole build. Excludedpackages/*— each package already has its owntsconfig.json.Githubicon removed from lucide-react — the installed v1.26 dropped brand icons. Swapped forGitFork(the button's label text already says "GitHub").InternalMemory.create()doesn't exist —admin/knowledge/page.tsxcalled a static factory method that was never part of the class. Fixed tonew InternalMemory(...)+.initialize(), matching the actual class API (and its own test file).DataTable<T>generic not inferred from JSX props — two admin tables passed untypedcolumnsarrays; TypeScript fell back to the base constraint. Added explicit<DataTable<T>>type arguments and the index signaturesT extends Record<string, unknown>requires.ResponsevsNextResponse— 6 API routes catch the plainResponsethatrequireAdmin()throws and return it directly, typed asNextResponse. Wrapped each innew NextResponse(...).apps.tsandcontent.ts'sFOOTER_LINKShad regressed to a wrong lineup (missing TaxFlowAI/LocalMate entirely, a fabricated "XeroAssist" entry that was never a real product) — traced viagit log -Sto 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/prerenderednpx tsc --noEmit/npx eslint src --quiet— cleannpm run start+ curl smoke test:/,/admin,/admin/costs,/admin/observability,/admin/knowledge,/api/admin/healthall return 200🤖 Generated with Claude Code