Hey, I keep running into an issue with Vercel deployments. When I set build as the public directory in Vercel the deployment is successful but it only shows an empty page. From what I've found out so far the issue is that payload builds result in two output directories, (dist and build) (https://payloadcms.com/docs/production/deployment
), while Vercel only serves files from one output directory (https://vercel.com/docs/concepts/deployments/configure-a-build
). Can anyone here who has deployed to vercel help me out with this or maybe send me a tutorial? Thank you so much!
Never worked with next but I don't think this is a solution as I'm just trying to get the default create-payload-app running, I already have a separate sveltekit project on vercel for my frontend
Ah right, I don't know next either, however that example was deployed to vercel by the payload team
So it may have some vercel-related infromation?
My guess is, to handle both build directories, youll need to configure vercel a littlehttps://vercel.com/docs/build-output-api/v3/configuration
Yes I also think I'll just have to change something in the Vercel config not on the Payload side. Unfortunately the repo doesn't seem to include a vercel config file. I'd ask this in a Vercel group but since this issue should come up every time someone trys to deploy payload to vercel I thought someone here might have already run into it
Hmm check outhttps://discord.com/channels/967097582721572934/1088447315385270322
You can also surch 'vercel deploy' in the top right to see all discussion related to that
I couldn't find a solution and I've moved to Railway now
hey @tile, if you are using the default
, it won't be able to be deployed on Vercel's platform. Payload runs on Express, and since Vercel is a serverless platform, there are some less-than-ideal workarounds needed to run an Express app on Vercel.
More on that here:https://vercel.com/guides/using-express-with-vercel
I see you are using sveltekit for your frontend, but if you wanted to use Next, you can use the
package to deploy Payload severlessly within a NextJS application, which is deployable on Vercel.