Skip to content

Comments

fix: Vercel production readiness for React/Vite SPA#61

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/assess-vercel-production-readiness
Draft

fix: Vercel production readiness for React/Vite SPA#61
Copilot wants to merge 2 commits intomainfrom
copilot/assess-vercel-production-readiness

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

Several vercel.json misconfigurations and missing Node version signals would cause broken deployments and silent runtime failures. This PR fixes the blockers and adds deployment documentation.

vercel.json fixes

  • Wrong env var nameVITE_BASE44_PROJECT_IDVITE_BASE44_APP_ID + VITE_BASE44_BACKEND_URL (matches actual app config; old name would silently be undefined at runtime)
  • Missing SPA fallback — added /(.*) → /index.html rewrite; without it, React Router hard-navigations and page refreshes 404
  • No-op rewrite removed/api/:path* → /api/:path* did nothing
  • Invalid Node version env var removedenv.NODE_VERSION in vercel.json is not how Vercel reads the Node version; replaced with proper signals below

Node version

  • Added .nvmrc20
  • Added engines.node: ">=20" to package.json

CI

  • actions/upload-artifact and actions/download-artifact: v3v4 (v3 is EOL)

Docs

  • README: added Deploy to Vercel section — one-click deploy badge, build settings table, required/optional env vars
  • docs/operations/VERCEL_READINESS_CHECKLIST.md: reusable 12-point audit template for other Krosebrook repos
Original prompt

Assess repository Krosebrook/interact (ref main) for Vercel production readiness and implement fixes to remove blockers.

Acceptance criteria:

  • Detect app type (Vercel Web App vs Vercel Functions/API vs N/A) and document it.
  • Ensure it builds and deploys on Vercel with minimal configuration.
  • Verify package manager/lockfile; add missing lockfile guidance.
  • Verify package.json scripts include build and start (or appropriate for framework).
  • Ensure Node version compatibility (add .nvmrc / engines field if helpful).
  • Add vercel.json only if necessary (monorepo, custom output, rewrites, functions config).
  • Add README section: Deploy to Vercel, build settings, output dir, required env vars.
  • Add .env.example capturing required env vars (no secrets).
  • Add/update GitHub Actions CI to run tests/build (optional but recommended).
  • Produce a short report in PR description: readiness status, detected framework, blockers fixed, remaining blockers.

Also create a high-level checklist template that can be reused to audit other Krosebrook repos for Vercel readiness (but only change files within this repo).

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Summary by cubic

Prepares this repo for Vercel by fixing vercel.json (env vars and SPA routing), adding Node 20 config, improving deploy docs, and upgrading CI. Aligns with the Linear task to assess Vercel readiness and remove blockers.

  • New Features

    • README: One‑click deploy, build settings (Vite, npm run build, dist), env vars table, SPA routing note.
    • vercel.json: correct VITE vars, remove NODE_VERSION, add catch‑all rewrite to /index.html, use npm ci.
    • Node 20 set via .nvmrc and engines.node.
    • CI: artifact actions upgraded to v4.
    • Reusable Vercel readiness checklist added.
  • Migration

    • App type: Vite SPA; build command and output dir configured.
    • Remaining: verify lockfile/install alignment (npm ci + package-lock.json) and set env vars in Vercel project.

Written for commit 04e7eae. Summary will update on new commits.

…es, deploy docs, CI upgrades

Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com>
Copilot AI changed the title [WIP] Assess repository for Vercel production readiness and implement fixes fix: Vercel production readiness for React/Vite SPA Feb 21, 2026
Copilot AI requested a review from Krosebrook February 21, 2026 02:32
@Krosebrook Krosebrook requested a review from Copilot February 21, 2026 22:11
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 fixes critical Vercel deployment blockers and adds comprehensive deployment documentation for the Interact platform. The changes align environment variables with actual code usage, enable proper React Router SPA fallback routing, establish Node.js version compatibility, upgrade deprecated CI actions, and provide detailed deployment guidance.

Changes:

  • Corrected environment variable names in vercel.json from incorrect VITE_BASE44_PROJECT_ID to actual VITE_BASE44_APP_ID and VITE_BASE44_BACKEND_URL used in the codebase
  • Added critical SPA fallback rewrite /(.*) → /index.html to prevent React Router 404s on hard navigation
  • Replaced invalid env.NODE_VERSION in vercel.json with proper Node 20 signals via .nvmrc and package.json engines field
  • Upgraded GitHub Actions artifact actions from EOL v3 to v4
  • Added comprehensive Vercel deployment documentation to README and created reusable readiness checklist

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vercel.json Fixed env var names (APP_ID + BACKEND_URL), removed invalid NODE_VERSION, added SPA catch-all rewrite, removed no-op API rewrite
package.json Added Node.js engines constraint (>=20) for Vercel detection
.nvmrc Added Node 20 version pin for local development and CI consistency
.github/workflows/ci.yml Upgraded upload-artifact and download-artifact from v3 to v4 (v3 EOL)
README.md Added Deploy to Vercel section with one-click deploy badge, build settings table, required/optional env vars, and SPA routing explanation
docs/operations/VERCEL_READINESS_CHECKLIST.md Created comprehensive 12-point audit template for Vercel deployments across Krosebrook repos

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