Deploying to Vercel

default discord avatar
tilelast year

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) (

), while Vercel only serves files from one output directory (

). Can anyone here who has deployed to vercel help me out with this or maybe send me a tutorial? Thank you so much!

  • default discord avatar
    notchrlast year

    @tile 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

    Which was linked from
  • default discord avatar
    tilelast year

    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

  • default discord avatar
    notchrlast year

    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
  • default discord avatar
    tilelast year

    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

  • default discord avatar
    notchrlast year

    Hmm check out

    You can also surch 'vercel deploy' in the top right to see all discussion related to that

  • default discord avatar
    tilelast year

    I couldn't find a solution and I've moved to Railway now

  • discord user avatar
    last year

    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:

    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.
Star on GitHub


Chat on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.