Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Image /> TypeError: Invalid URL #405

Closed
Karnak19 opened this issue May 14, 2024 · 1 comment
Closed

<Image /> TypeError: Invalid URL #405

Karnak19 opened this issue May 14, 2024 · 1 comment

Comments

@Karnak19
Copy link

Karnak19 commented May 14, 2024

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
Copy link
Author

I found the issue was due to my blurData generation function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant