From 4b941ff318f1700d455667d37471e876b38a0e24 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 19 Jun 2025 12:57:39 +0200 Subject: [PATCH 1/2] Fix Vercel deployment to serve React client instead of server code --- client/package.json | 1 + vercel.json | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index 2c339d5..9ccea53 100644 --- a/client/package.json +++ b/client/package.json @@ -4,6 +4,7 @@ "type": "module", "scripts": { "build": "vite build", + "vercel-build": "vite build", "dev": "vite", "preview": "vite preview" }, diff --git a/vercel.json b/vercel.json index 0704e6c..1085861 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,6 @@ { "version": 2, - "buildCommand": "cd client && npm install && npm run build", + "buildCommand": "npm run build", "outputDirectory": "client/dist", "builds": [ { @@ -13,6 +13,10 @@ "src": "/api/(.*)", "dest": "/server/index.ts" }, + { + "src": "/assets/(.*)", + "dest": "/assets/$1" + }, { "src": "/(.*)", "dest": "/index.html" From 35d7a42e32e362c2039225e6c42661c03a187e6f Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 19 Jun 2025 13:00:17 +0200 Subject: [PATCH 2/2] Fix Vercel configuration: use functions instead of builds to avoid conflict --- vercel.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/vercel.json b/vercel.json index 1085861..c797450 100644 --- a/vercel.json +++ b/vercel.json @@ -2,12 +2,11 @@ "version": 2, "buildCommand": "npm run build", "outputDirectory": "client/dist", - "builds": [ - { - "src": "server/index.ts", - "use": "@vercel/node" + "functions": { + "server/index.ts": { + "maxDuration": 30 } - ], + }, "routes": [ { "src": "/api/(.*)", @@ -21,10 +20,5 @@ "src": "/(.*)", "dest": "/index.html" } - ], - "functions": { - "server/index.ts": { - "maxDuration": 30 - } - } + ] } \ No newline at end of file