Skip to content

Fix Convex shell environment handling - #30

Merged
nicu-chiciuc merged 2 commits into
mainfrom
codex-convex-shell-boundary
Aug 5, 2026
Merged

Fix Convex shell environment handling#30
nicu-chiciuc merged 2 commits into
mainfrom
codex-convex-shell-boundary

Conversation

@nicu-chiciuc

@nicu-chiciuc nicu-chiciuc commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Why

Convex already supplies VITE_CONVEX_URL: convex dev writes it for local development, and
convex deploy --cmd injects the selected deployment URL into production and preview builds. The
starter instead displayed manual setup instructions when the value was absent, and an
environment-free build could prerender that message as the home page.

The fix must preserve the existing rendering contract: exact / and /about are static generated
pages, while /index.html remains the route-neutral SPA fallback for other app routes.

Change

  • mount the Convex provider only around the todo route that uses it
  • fail clearly when the real Convex-backed route runs outside a supported dev or deploy command
  • preserve exact / at /_landing.html, /about at /about/index.html, and the SPA shell at
    /index.html
  • keep the explicit prerender list as the shared source for TanStack Start and the generated
    _redirects block
  • document why the Cloudflare-specific root split exists and when it can be reconsidered
  • use a CI-only local Convex URL for the discarded GitHub Actions build artifact; development and
    Cloudflare builds still receive the real URL from Convex
  • document that Cloudflare needs both Convex deploy keys, but not VITE_CONVEX_URL

Validation

  • vp run check
  • VITE_CONVEX_URL=http://127.0.0.1:3210 vp run build
  • VITE_CONVEX_URL=http://127.0.0.1:3210 CLOUDFLARE_WORKER_NAME=samebase-app vp run deploy:dry-run
  • VITE_CONVEX_URL=http://127.0.0.1:3210 CLOUDFLARE_WORKER_NAME=samebase-app vp run deploy:preview:dry-run
  • verified dist/client/index.html, dist/client/_landing.html,
    dist/client/about/index.html, and the generated exact redirects
  • verified that none of the generated HTML files contains the old manual Convex setup message

@nicu-chiciuc
nicu-chiciuc merged commit 5f2f2a6 into main Aug 5, 2026
6 checks passed
@nicu-chiciuc
nicu-chiciuc deleted the codex-convex-shell-boundary branch August 5, 2026 14:06
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.

1 participant