fix(minting-service): rename api/ to handlers/ so Vercel uses Build Output API#134
Merged
Merged
Conversation
The Nx esbuild build (PR #133) produced a correct Build Output API v3 layout under `.vercel/output/functions/api/*.func/`, but Vercel's default Node builder still auto-detects `api/*.ts` at the project root and runs `@vercel/node` on top of our output. That failed with `api/health.ts: Emit skipped` because @vercel/node's tsc doesn't resolve the workspace tsconfig paths. Rename `apps/minting-service/api/` → `apps/minting-service/handlers/` so Vercel's auto-detection finds nothing and falls back to the Build Output API our buildCommand already produces. The deployed URL path (`/api/health`, `/api/stripe-webhook`) is unchanged — esbuild still emits to `.vercel/output/functions/api/<name>.func/`. Co-Authored-By: Claude Opus 4 <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
Follow-up to #133. The Nx build produces a correct Build Output API v3 layout, but Vercel's default Node builder still auto-detects
api/*.tsat the project rootDirectory and runs@vercel/nodeon top of our output. That failed the first production deploy withapi/health.ts: Emit skippedbecause@vercel/node's tsc doesn't resolve workspace tsconfig paths (@cacheplane/db,@cacheplane/licensing).Fix
Rename
apps/minting-service/api/→apps/minting-service/handlers/so Vercel's auto-detection finds nothing at the rootDirectory and falls back to the.vercel/output/layout our buildCommand already produces.The deployed URL path is unchanged — esbuild still emits to
.vercel/output/functions/api/<name>.func/, which Vercel maps to/api/<name>by convention.Test plan
npx nx build minting-servicestill produces valid output;require()loads default handler for both functionsnpx nx test minting-servicepassescurl https://<prod>/api/health→{"ok":true}🤖 Generated with Claude Code