Images for our application are being delivered by Contentful and are returned in this format
//images.ctfassets.net/6hyijb95boju/1t0phGFzVDeI8jt26k2FYp/522df3e206b753309382bcc06f93234d/2VS_View_1.jpg
Note it's not returned with http(s). The Next.js Image component is not rendering the image.
Is there a way to fix this without manually prefixing the url's in components?
Steps to reproduce the behavior, please provide code snippets or a repository:
images: {
deviceSizes: [480, 750, 1200, 1920],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
domains: ["images.ctfassets.net"],
path: '/_next/image',
loader: 'default',
},
//images.ctfassets.net/6hyijb95boju/1t0phGFzVDeI8jt26k2FYp/522df3e206b753309382bcc06f93234d/2VS_View_1.jpg) to Image prop src[Error: Input buffer contains unsupported image format]
Optimized Image renders
This isn't a bug, it's 'intentional' in a sense.
Related: https://github.com/vercel/next.js/pull/18809
Explanation: https://github.com/vercel/next.js/issues/18536#issuecomment-719993535
Yup! This is intentional. Be sure you prefix this URL with https!
Thanks guys !
Do you know if there is any intention in possibly adding this to the config in next.config.js ?
possibly a flag to serve all remote assets over https
images: {
domains: ["images.ctfassets.net"],
https: true
}
or, maybe change the array of domain strings to be a config object
images: {
domains: [
{
src: "images.ctfassets.net",
https: true
}
]
Most helpful comment
This isn't a bug, it's 'intentional' in a sense.
Related: https://github.com/vercel/next.js/pull/18809
Explanation: https://github.com/vercel/next.js/issues/18536#issuecomment-719993535