Hello! I am migrating my project to a monorepo setup using the new Vercel Services Beta.
My project has an Express backend (packages/server/) and an Expo Web frontend (packages/client/).
Everything builds successfully and routes perfectly when clicking links from the home page. However, performing a browser refresh on a nested route (e.g. /c/1234) triggers a Vercel 404: NOT_FOUND error.
Here is my root vercel.json configuration:
{ "services": { "my_frontend": { "root": "packages/client/", "outputDirectory": "dist" }, "my_backend": { "root": "packages/server/", "entrypoint": "src/index.ts" } }, "rewrites": [ { "source": "/api/(.*)", "destination": { "service": "my_backend" } }, { "handle": "filesystem" }, { "source": "/((?!api).*)*", "destination": { "service": "my_frontend", "path": "index.html" } } ]}
Any advice on how to correctly configure the SPA routing fallback for static service assets would be greatly appreciated!