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!
I do not have experience with vercel, I'm sure a bunch of folks do, but I did find this example Repo that may be relevant
https://github.com/payloadcms/next-payloadWhich was linked from
https://nextjs-vercel.payloadcms.com/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 little
https://vercel.com/docs/build-output-api/v3/configurationYes 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 out
https://discord.com/channels/967097582721572934/1088447315385270322You 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
@1019671981651677214, if you are using the default
create-payload-app
, 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-vercelI see you are using sveltekit for your frontend, but if you wanted to use Next, you can use the
next-payload
package to deploy Payload severlessly within a NextJS application, which is deployable on Vercel.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.