Error: relation "users" does not exist Deploy on Vercel
lctone opened this issue · 3 comments
Can you please check this ?
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
Thank you very much
[14:01:43.602] Running build in Washington, D.C., USA (East) – iad1
[14:01:44.180] Previous build cache not available
[14:01:44.821] Cloning completed: 1.043s
[14:01:45.485] Running "vercel build"
[14:01:46.355] Vercel CLI 33.7.1
[14:01:47.115] Warning: Detected "engines": { "node": ">=18.19.0" } in your package.json that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[14:01:47.163] Detected pnpm-lock.yaml version 6 generated by pnpm 8
[14:01:47.204] Installing dependencies...
[14:01:48.293] Lockfile is up to date, resolution step is skipped
[14:01:48.493] Progress: resolved 1, reused 0, downloaded 0, added 0
[14:01:48.875] Packages: +782
[14:01:48.875] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[14:01:49.500] Progress: resolved 782, reused 0, downloaded 10, added 0
[14:01:50.501] Progress: resolved 782, reused 0, downloaded 39, added 27
[14:01:51.501] Progress: resolved 782, reused 0, downloaded 101, added 87
[14:01:52.519] Progress: resolved 782, reused 0, downloaded 130, added 116
[14:01:53.520] Progress: resolved 782, reused 0, downloaded 136, added 124
[14:01:54.521] Progress: resolved 782, reused 0, downloaded 195, added 184
[14:01:55.521] Progress: resolved 782, reused 0, downloaded 248, added 233
[14:01:56.533] Progress: resolved 782, reused 0, downloaded 278, added 264
[14:01:57.526] Progress: resolved 782, reused 0, downloaded 299, added 284
[14:01:58.562] Progress: resolved 782, reused 0, downloaded 319, added 304
[14:01:59.582] Progress: resolved 782, reused 0, downloaded 342, added 329
[14:02:00.577] Progress: resolved 782, reused 0, downloaded 355, added 342
[14:02:01.579] Progress: resolved 782, reused 0, downloaded 358, added 348
[14:02:02.579] Progress: resolved 782, reused 0, downloaded 396, added 378
[14:02:03.589] Progress: resolved 782, reused 0, downloaded 469, added 466
[14:02:04.580] Progress: resolved 782, reused 0, downloaded 532, added 522
[14:02:05.589] Progress: resolved 782, reused 0, downloaded 699, added 685
[14:02:06.212] Progress: resolved 782, reused 0, downloaded 782, added 782, done
[14:02:06.500] .../es5-ext@0.10.64/node_modules/es5-ext postinstall$ node -e "try{require('./_postinstall')}catch(e){}" || exit 0
[14:02:07.327] .../es5-ext@0.10.64/node_modules/es5-ext postinstall: Done
[14:02:07.416] .../node_modules/@swc/core postinstall$ node postinstall.js
[14:02:07.431] .../esbuild@0.18.20/node_modules/esbuild postinstall$ node install.js
[14:02:07.442] .../esbuild@0.19.12/node_modules/esbuild postinstall$ node install.js
[14:02:07.488] .../node_modules/@swc/core postinstall: Done
[14:02:07.512] .../esbuild@0.18.20/node_modules/esbuild postinstall: Done
[14:02:07.537] .../esbuild@0.19.12/node_modules/esbuild postinstall: Done
[14:02:07.594] .../sharp@0.32.6/node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
[14:02:07.742] .../sharp@0.32.6/node_modules/sharp install: sharp: Using cached /vercel/.npm/_libvips/libvips-8.14.5-linux-x64.tar.br
[14:02:08.001] .../sharp@0.32.6/node_modules/sharp install: sharp: Integrity check passed for linux-x64
[14:02:08.312] .../sharp@0.32.6/node_modules/sharp install: Done
[14:02:08.489]
[14:02:08.489] dependencies:
[14:02:08.489] + @payloadcms/db-postgres 3.0.0-beta.10
[14:02:08.489] + @payloadcms/next 3.0.0-beta.10
[14:02:08.489] + @payloadcms/plugin-cloud-storage 3.0.0-beta.10
[14:02:08.489] + @payloadcms/richtext-lexical 3.0.0-beta.10
[14:02:08.489] + @payloadcms/translations 3.0.0-beta.10
[14:02:08.489] + @vercel/blob 0.22.3
[14:02:08.489] + cross-env 7.0.3
[14:02:08.489] + lucide-react 0.368.0
[14:02:08.489] + next 14.2.0-canary.33
[14:02:08.490] + payload 3.0.0-beta.10
[14:02:08.490] + react 18.2.0
[14:02:08.490] + react-dom 18.2.0
[14:02:08.490] + sharp 0.32.6
[14:02:08.490]
[14:02:08.491] devDependencies:
[14:02:08.491] + @types/node 20.12.7
[14:02:08.491] + @types/react 18.2.77
[14:02:08.491] + @types/react-dom 18.2.25
[14:02:08.491] + autoprefixer 10.4.19
[14:02:08.491] + eslint 8.57.0
[14:02:08.491] + eslint-config-next 14.1.4
[14:02:08.491] + postcss 8.4.38
[14:02:08.491] + tailwindcss 3.4.3
[14:02:08.491] + typescript 5.4.5
[14:02:08.491]
[14:02:08.509] Done in 21.2s
[14:02:08.572] Detected Next.js version: 14.2.0-canary.33
[14:02:08.586] Running "pnpm run build"
[14:02:09.086]
[14:02:09.086] > payload3beta9@1.0.0 build /vercel/path0
[14:02:09.086] > cross-env NODE_OPTIONS=--no-deprecation next build
[14:02:09.086]
[14:02:09.762] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[14:02:09.763] This information is used to shape Next.js' roadmap and prioritize features.
[14:02:09.763] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[14:02:09.763] https://nextjs.org/telemetry
[14:02:09.763]
[14:02:09.820] ▲ Next.js 14.2.0-canary.33
[14:02:09.821]
[14:02:09.897] Creating an optimized production build ...
[14:02:57.311] ✓ Compiled successfully
[14:02:57.312] Linting and checking validity of types ...
[14:03:04.188] Collecting page data ...
[14:03:06.940] Generating static pages (0/17) ...
[14:03:07.532] Generating static pages (4/17)
[14:03:08.781] Generating static pages (8/17)
[14:03:08.936] Generating static pages (12/17)
[14:03:11.084]
[14:03:11.084] Error occurred prerendering page "/my-route". Read more: https://nextjs.org/docs/messages/prerender-error
[14:03:11.084]
[14:03:11.086] error: relation "users" does not exist
[14:03:11.086] at /vercel/path0/.next/server/chunks/1929.js:152:182537
[14:03:11.087] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[14:03:11.087] at async /vercel/path0/.next/server/chunks/1929.js:171:25971
[14:03:11.087] at async ib (/vercel/path0/.next/server/chunks/1929.js:208:2731)
[14:03:11.087] at async m (/vercel/path0/.next/server/chunks/1929.js:231:20518)
[14:03:11.087] at async n (/vercel/path0/.next/server/app/my-route/route.js:1:1449)
[14:03:11.087] at async /vercel/path0/node_modules/.pnpm/next@14.2.0-canary.33_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:34635
[14:03:11.087] at async eS.execute (/vercel/path0/node_modules/.pnpm/next@14.2.0-canary.33_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:25850)
[14:03:11.087] at async eS.handle (/vercel/path0/node_modules/.pnpm/next@14.2.0-canary.33_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:35889)
[14:03:11.087] at async exportAppRoute (/vercel/path0/node_modules/.pnpm/next@14.2.0-canary.33_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/export/routes/app-route.js:77:26)
[14:03:11.100] ✓ Generating static pages (17/17)
[14:03:11.106]
[14:03:11.106] > Export encountered errors on following paths:
[14:03:11.106] /my-route/route: /my-route
[14:03:11.198] ELIFECYCLE Command failed with exit code 1.
[14:03:11.212] Error: Command "pnpm run build" exited with 1
[14:03:11.658]
This is likely because your migration did not run.
Can you verify your ci script in package.json is "ci": "payload migrate && pnpm build", and your build command in vercel is pnpm run ci ?
I had this issue when adding a pages collection to prod. This issue seems to be that the migrations folder is not being updated automatically when I added the collection to my payload.config.ts.
I fixed my deployment by running: npm run payload migrate:create and pushing the generated files to prod.
I fixed my deployment by running: npm run payload migrate:create and pushing the generated files to prod.
This is the correct way to handle migrations, and Payload does not do this for you.