From ec618ab07b8a239a3d942588b03d39efd7cfe703 Mon Sep 17 00:00:00 2001 From: Himess Date: Wed, 28 Oct 2026 01:45:08 +0300 Subject: [PATCH] scripts: the /live/ redirect matches its trailing slash Vercel matches a redirect's source strictly, and with trailingSlash every request arrives as /live/...: /live/:path* never matched it, so /live/ gave the 404 page. /live/(.*) to /app/$1 takes the slash along (checked on the production deployment: /live/ and /live/borrow/ answer 307 to /app/ and /app/borrow/). Co-Authored-By: Claude Opus 5.5 --- scripts/deploy-vercel.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-vercel.sh b/scripts/deploy-vercel.sh index 413c932..32723f3 100644 --- a/scripts/deploy-vercel.sh +++ b/scripts/deploy-vercel.sh @@ -85,7 +85,8 @@ fi if [ -z "$live" ]; then node -e ' const fs = require("fs"), file = process.argv[1], v = JSON.parse(fs.readFileSync(file, "utf8")); - v.redirects = [{ source: "/live/:path*", destination: "/app/:path*", permanent: false }]; + // Vercel matches a source strictly, trailing slash included (trailingSlash above): (.*) takes it along. + v.redirects = [{ source: "/live/(.*)", destination: "/app/$1", permanent: false }]; fs.writeFileSync(file, JSON.stringify(v, null, 2) + "\n");' "$out/vercel.json" fi if [ "$build_only" = 1 ]; then echo "Built into $out"; exit 0; fi