Can i deploy a custom server with nextjs on payload cloud? I have been trying to deploy but the next build keeps failing, "INVALID_URL"
and also the logs disappears when the deployment fails.
[2023-09-17T22:59:51] - info Collecting page data...
[2023-09-17T22:59:52] TypeError [ERR_INVALID_URL]: Invalid URL
[2023-09-17T22:59:52] at new NodeError (node:internal/errors:387:5)
[2023-09-17T22:59:52] at URL.onParseError (node:internal/url:565:9)
[2023-09-17T22:59:52] at new URL (node:internal/url:641:5)
[2023-09-17T22:59:52] at Object.2108 (/workspace/.next/server/chunks/221.js:1609:19)
[2023-09-17T22:59:52] at Function.
webpack_require(/workspace/.next/server/webpack-runtime.js:25:42)
[2023-09-17T22:59:52] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-09-17T22:59:52] at async collectGenerateParams (/workspace/node_modules/next/dist/build/utils.js:825:17)
[2023-09-17T22:59:52] at async /workspace/node_modules/next/dist/build/utils.js:1038:17
[2023-09-17T22:59:52] at async Span.traceAsyncFn (/workspace/node_modules/next/dist/trace/trace.js:103:20) {
[2023-09-17T22:59:52] input: '',
[2023-09-17T22:59:52] code: 'ERR_INVALID_URL'
[2023-09-17T22:59:52] }
[2023-09-17T22:59:52] unhandledRejection Error: Failed to collect page data for /page/[slug]
[2023-09-17T22:59:52] at /workspace/node_modules/next/dist/build/utils.js:1158:15
[2023-09-17T22:59:52] at processTicksAndRejections (node:internal/process/task_queues:96:5)
Was missing PAYLOAD_PUBLIC_SERVER_URL env variable..
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.