vercel / platforms

A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
https://app.vercel.pub
5.38k stars 688 forks source link

<Image /> TypeError: Invalid URL #405

Closed Karnak19 closed 1 month ago

Karnak19 commented 1 month ago

Hello, I've trouble with Image while deployed in production.

When working in localhost with dev server it works perfectly: Screenshot 2024-05-14 at 12 02 58

But when deployed in production on Vercel, I got an error in Logs:

https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-green-leaves.jpg&w=16&q=75
at new Request (node:internal/deps/undici/undici:5855:19)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
... 4 lines matching cause stack trace ...
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
digest: '1153500190',
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at new Request (node:internal/deps/undici/undici:5853:25)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
at B (/var/task/.next/server/chunks/948.js:2:6846)
at /var/task/.next/server/chunks/948.js:2:9092
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async u (/var/task/.next/server/app/[domain]/page.js:1:4823)
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
code: 'ERR_INVALID_URL',
input: 'undefined/_next/image?url=https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-green-leaves.jpg&w=16&q=75'
}
}
⨯ TypeError: Failed to parse URL from undefined/_next/image?url=https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-bell-peppers.jpg&w=16&q=75
at new Request (node:internal/deps/undici/undici:5855:19)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
... 4 lines matching cause stack trace ...
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
digest: '4115992318',
page: '/big-pizz.crustify.fr',
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at new Request (node:internal/deps/undici/undici:5853:25)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
at B (/var/task/.next/server/chunks/948.js:2:6846)
at /var/task/.next/server/chunks/948.js:2:9092
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async u (/var/task/.next/server/app/[domain]/page.js:1:4823)
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
code: 'ERR_INVALID_URL',
input: 'undefined/_next/image?url=https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-bell-peppers.jpg&w=16&q=75'
}
}
TypeError: Failed to parse URL from undefined/_next/image?url=https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-bell-peppers.jpg&w=16&q=75
at new Request (node:internal/deps/undici/undici:5855:19)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
... 4 lines matching cause stack trace ...
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
digest: '4115992318',
page: '/big-pizz.crustify.fr',
[cause]: TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at new Request (node:internal/deps/undici/undici:5853:25)
at a (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:180691)
at B (/var/task/.next/server/chunks/948.js:2:6846)
at /var/task/.next/server/chunks/948.js:2:9092
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async u (/var/task/.next/server/app/[domain]/page.js:1:4823)
at async m (/var/task/.next/server/app/[domain]/page.js:10:413) {
code: 'ERR_INVALID_URL',
input: 'undefined/_next/image?url=https://nmjhpbgvbzkikazppran.supabase.co/storage/v1/object/public/pizzas/b6fb0ccd-8d17-477e-a2f4-490ce2fa51bd/1/Pizza-with-bell-peppers.jpg&w=16&q=75'
}
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.

Which leads to a 500 internal server error

Screenshot 2024-05-14 at 12 05 56

The fun fact, on https://app.[domain], it works just fine: Screenshot 2024-05-14 at 12 41 18

Karnak19 commented 1 month ago

I found the issue was due to my blurData generation function