Skip to content

Comments

fix: Vercel production readiness for React SPA (vercel.json, .nvmrc, engines)#62

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/audit-krosebrook-for-vercel
Draft

fix: Vercel production readiness for React SPA (vercel.json, .nvmrc, engines)#62
Copilot wants to merge 2 commits intomainfrom
copilot/audit-krosebrook-for-vercel

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

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.json

  • Replaced incorrect build.env block (VITE_BASE44_PROJECT_ID / VITE_API_URL) — neither var is read by the app; actual vars are VITE_BASE44_APP_ID + VITE_BASE44_BACKEND_URL, documented in README instead
  • Replaced no-op /api/:path* → /api/:path* rewrite (no api/ functions directory) and invalid /login → /auth/login redirect (route doesn't exist) with the required SPA catch-all:
    "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
  • Removed env.NODE_VERSION (Vercel doesn't use this key for runtime selection)

Node version pinning

  • Added .nvmrc20 (Vercel's canonical detection mechanism)
  • Added engines: { node: ">=20", npm: ">=10" } to package.json

README.md

  • Added "Deploying to Vercel" section: project type, one-click deploy button, framework settings, required vs optional env var table, and a note that secrets must not be placed in VITE_ vars

Remaining manual steps

  • Set VITE_BASE44_APP_ID and VITE_BASE44_BACKEND_URL in the Vercel dashboard → Settings → Environment Variables
Original prompt

Audit Krosebrook/interact (ref main) for Vercel production readiness and implement any necessary fixes to make it deployable on Vercel.

Requirements:

  • Detect project type (Vercel Web App, Vercel Functions/API, or N/A) and document it in README.
  • Ensure Vercel deployment works with minimal configuration.
  • Confirm package manager and lockfile usage; ensure build/install is deterministic.
  • Verify package.json scripts include required build/start (or framework-appropriate) scripts.
  • Ensure Node version compatibility (optionally add .nvmrc and/or package.json engines).
  • Add vercel.json only if needed (monorepo, custom output dir, SPA rewrites, functions config).
  • Add .env.example listing required env vars (no secrets) and document them.
  • Update README with Vercel deploy instructions, build command/output directory, and env var setup.
  • Optionally add GitHub Actions workflow to run lint/tests/build.
  • Provide a report in the PR description: what blockers were found, what was fixed, and any remaining manual steps.

Context: User said "no, do it" and provided repoOwner=Krosebrook repoName=interact ref=main.

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.

…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
Copilot AI requested a review from Krosebrook February 21, 2026 02:35
@Krosebrook Krosebrook requested a review from Copilot February 21, 2026 23:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json by 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) and package.json engines 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

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