internal server error when deploying to DigitalOcean
When entering some specific pages in my site, the server gets an error and shuts down.
Why is this happening?
I run it locally - everything works
I run it on vercel - everything works
But on DigitalOcean it breaks
I have a loop of errors of this type:
`
7 Replies
Ok, this only happens when I try to display an image on a page that is NOT from the same origin URL
But why does the server break though?
I already configured my NextJS config:
```
images: {
remotePatterns: [
{
protocol: "https",
hostname: "",
},
{
protocol: "http",
hostname: "",
},
],
},
This might be a next js version issue. Trying to follow this:
https://medium.com/@pawanjotkaurbaweja/solved-typeerror-fetch-failed-4f7d304c0c68
Will update if it works
after spending an entire day digging I gave up and went back to vercel
what's the right way to allow loading images from any website then?
keep in mind that this works both locally and on Vercel, and it works on DigitalOcean too but only on DigitalOcean the server randomly collapse
The
hostname
must be filled in
The docs mention the other parts are optional and will default to **
but hostname
is the most important part to list domains other than the current app's domain that you're optimizing images from
(And ideally, all the fields should be filled in to be the most secure)
https://nextjs.org/docs/app/api-reference/components/image#remotepatterns
(There might be another issue cause I'm surprised it'd work on Vercel this way, but that's the most glaring one. You can also reference the deprecated domains
config for more context.)
I think the image format detection is more about new formats that aren't widely supported. Webp still doesn't work in IE and there might have been others when this feature was developed. Plus whatever the next hot new image format will be.
Can find more info: https://nextjs.org/docs/app/building-your-application/optimizing/imagesOk I created a droplet on digital ocean again, but the problem persists.
I fixed the remoetPatterns according to the next js docs.
Why is this error happening?
This is so random.
I have a website where users can upload images and I'm using cloudinary as my provider, which later I display with
Image
component from Next js
When I enter some pages with some photos, the server collapse giving me the error above
I guess, but I'm not attempting to make any connection
I'm just trying to view a webpageI'm not doing anything goofy :theowat:
And it works perefctly when hosted on Vercel - https://unpaack.com
Would you be kind to inspect this live with me?
Unpaack
Unpaack is where you discover the products used by the people you follow
i'm doomed