Nextjs Custom server, Payload cloud

default discord avatar
last week

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.



[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..

    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.