I wanted to create a minimal payload / nextjs app without the template boilerplate, so I did
npx create-next-app@latest
then
yarn add @payloadcms/next-payload payload
and
yarn next-payload install
... the project runs fine both with
dev
and
build
+
start
... but when I deploy to vercel, I get the following error:
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".
I've tried duplicating the payload.config.ts file in multiple places, including the root as well as the
./payload
folder ... the
config
is being properly set (
configPath: path.resolve(__dirname, './payload/payload.config.ts'),
), and I've tried all variations of path in root, with and without the starting
./
... does anyone have any ideas?
Have you tried setting the config property as shown in step 4 here:
https://github.com/payloadcms/next-payloadugh - that was it ... thank you!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.