fix: Vercel production readiness for React SPA (vercel.json, .nvmrc, engines)#62
Draft
fix: Vercel production readiness for React SPA (vercel.json, .nvmrc, engines)#62
Conversation
…engines, README deploy docs Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Audit Krosebrook interact for Vercel production readiness
fix: Vercel production readiness for React SPA (vercel.json, .nvmrc, engines)
Feb 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses critical blockers preventing reliable Vercel deployment by fixing incorrect build-time environment variables, adding the required SPA routing configuration, and pinning the Node.js version.
Changes:
- Fixed
vercel.jsonby removing incorrect environment variables (VITE_BASE44_PROJECT_ID,VITE_API_URL) and replacing invalid rewrites/redirects with the SPA catch-all rewrite required for React Router - Added Node.js version pinning via
.nvmrc(20) andpackage.jsonengines field (node >=20, npm >=10) - Added comprehensive Vercel deployment documentation to README with one-click deploy button, manual deploy instructions, and environment variable requirements
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| vercel.json | Removed incorrect build.env variables and invalid /api rewrite; added SPA catch-all rewrite for React Router compatibility; removed unused env.NODE_VERSION |
| .nvmrc | Added Node.js version 20 pinning (Vercel's canonical detection mechanism) |
| package.json | Added engines field requiring node >=20 and npm >=10 for deployment consistency |
| README.md | Added comprehensive "Deploying to Vercel" section with one-click deploy button, framework settings, required/optional environment variables table, and security note about VITE_ prefixed variables |
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.
Several blockers prevented reliable Vercel deployment: wrong build-time env var names baked into
vercel.json, no SPA catch-all rewrite (causing 404s on React Router deep-links), stale/invalid rewrites and redirects, and no Node version pinning.Changes
vercel.jsonbuild.envblock (VITE_BASE44_PROJECT_ID/VITE_API_URL) — neither var is read by the app; actual vars areVITE_BASE44_APP_ID+VITE_BASE44_BACKEND_URL, documented in README instead/api/:path* → /api/:path*rewrite (noapi/functions directory) and invalid/login → /auth/loginredirect (route doesn't exist) with the required SPA catch-all:env.NODE_VERSION(Vercel doesn't use this key for runtime selection)Node version pinning
.nvmrc→20(Vercel's canonical detection mechanism)engines: { node: ">=20", npm: ">=10" }topackage.jsonREADME.mdVITE_varsRemaining manual steps
VITE_BASE44_APP_IDandVITE_BASE44_BACKEND_URLin the Vercel dashboard → Settings → Environment VariablesOriginal prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
Summary by cubic
Make the app Vercel-ready by pinning Node 20 (.nvmrc + engines), adding Vercel deploy docs (Vite SPA, one‑click button, required VITE_* vars), and cleaning vercel.json (SPA catch‑all, remove invalid redirect, /api passthrough, NODE_VERSION).
Written for commit d473497. Summary will update on new commits.