Cannot find Payload config 500 errors with Next.js on Vercel

default discord avatar
2 weeks ago

Started a fresh Next.js app and downgraded to 13.5.6, installed next-payload and payload and ran

yarn next-payload install

. I also moved my payload config to my root directory and updated the env variable and


config. After deploying to Vercel and opening


, I get 500 errors from






with this error:

Error: cannot find Payload config. Please create a configuration file located at the root of your current working directory called "payload.config.js" or "payload.config.ts"

payload 2.1.1

@payloadcms/next-payload 0.1.9

@payloadcms/db-postgres 0.1.13

@payloadcms/richtext-slate 1.1.0

next 13.5.6

EDIT: confirmed that the config path is set correctly per this conversation

This was solved by added the


environment variable in Vercel

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

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