Vercel deployment fail
Unanswered
Serengeti posted this in #help-forum
SerengetiOP
Hey guys!
I am trying to host a nextjs project on Vercel.
When I run npm run build, everything works flawlessly, however when Vercel runs the command it returns this:
"""
TypeError: Invalid URL
at new URL (node:internal/url:797:36)
at 9678 (/vercel/path0/.next/server/chunks/639.js:1:35198)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:127)
at 2519 (/vercel/path0/.next/server/app/_not-found/page.js:1:1052)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:127)
at r (/vercel/path0/.next/server/app/_not-found/page.js:1:3772)
at /vercel/path0/.next/server/app/_not-found/page.js:1:3807
at t.X (/vercel/path0/.next/server/webpack-runtime.js:1:1191)
at /vercel/path0/.next/server/app/_not-found/page.js:1:3785
at Object.<anonymous> (/vercel/path0/.next/server/app/_not-found/page.js:1:3834) {
code: 'ERR_INVALID_URL',
input: 'undefined'
}
at /vercel/path0/node_modules/next/dist/build/utils.js:1268:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'Error'
}
Error: Command "npm run build" exited with 1
"""
I am trying to host a nextjs project on Vercel.
When I run npm run build, everything works flawlessly, however when Vercel runs the command it returns this:
"""
TypeError: Invalid URL
at new URL (node:internal/url:797:36)
at 9678 (/vercel/path0/.next/server/chunks/639.js:1:35198)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:127)
at 2519 (/vercel/path0/.next/server/app/_not-found/page.js:1:1052)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:127)
at r (/vercel/path0/.next/server/app/_not-found/page.js:1:3772)
at /vercel/path0/.next/server/app/_not-found/page.js:1:3807
at t.X (/vercel/path0/.next/server/webpack-runtime.js:1:1191)
at /vercel/path0/.next/server/app/_not-found/page.js:1:3785
at Object.<anonymous> (/vercel/path0/.next/server/app/_not-found/page.js:1:3834) {
code: 'ERR_INVALID_URL',
input: 'undefined'
}
Build error occurredError: Failed to collect page data for /_not-found
at /vercel/path0/node_modules/next/dist/build/utils.js:1268:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'Error'
}
Error: Command "npm run build" exited with 1
"""
1 Reply
did you setup envs on vercel?