-
Link to reproductionNo response Payload Version3.0.0-beta.36 Node Versionv21.4.0 Next.js Version15.0.0-rc.0 Describe the BugI can't fetch images from the local api and display them in an component In dev mode everything works fine
And it works just fine. The But when i deployed it to Vercel when going to https://starbucks-clone-orpin.vercel.app/api/media/file/137-92091.jpeg the image loads but when the Reproduction StepsRepository : https://github.com/poofy25/starbucks-clone
Adapters and Plugins@payloadcms/storage-uploadthing |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 3 replies
-
I'm getting the same error when trying to display images in a Vercel deployment using a Supabase S3 bucket. Any solutions? |
Beta Was this translation helpful? Give feedback.
-
So i found a workaround for this issue all you gotta do is add the website url in the image src path Before: After |
Beta Was this translation helpful? Give feedback.
-
Hey all, yes, as @poofy25 said, on your frontend, I believe you need to pass full URLs to the |
Beta Was this translation helpful? Give feedback.
-
This isn't working when using S3 bucket storage and Vercel deployment. Even using absolute urls. |
Beta Was this translation helpful? Give feedback.
-
Also getting this error still. @jmikrut Can we have someone relook into this? |
Beta Was this translation helpful? Give feedback.
-
Im also running with this issue, using absolute url does not fix the issue. Clicking and redirecting to the path it actually returns the image https://your-site/api/media/file/photo.png but when rendering in the next image getting the same error 400: BAD_REQUEST |
Beta Was this translation helpful? Give feedback.
-
Same problem here, having absolute url doesnt fix it. |
Beta Was this translation helpful? Give feedback.
-
I understand the argument to close the issue that the problem is with Next's image optimizer, but at the same time if Payload intends to have a default configuration that can be hosted on Vercel, the team needs to worry about this issue. Once there is a stable version available to a wider audience, this problem will make it impossible to use without headaches. |
Beta Was this translation helpful? Give feedback.
So i found a workaround for this issue all you gotta do is add the website url in the image src path
For example
Before:
<Image src={image.url} ...>
After
<Image src={
${process.env.WEBSITE_URL}${image.url}
} />