Next.js Image Component Not Handling WebP Format Correctly with Custom Loader
I'm having a hard time understanding I am working with an scenario with the Next.js Image component when trying to serve images in WebP format using a custom loader... I have set up a custom loader that determines the optimal image URL based on the device's capabilities. However, when I attempt to load a WebP image, it either falls back to JPEG or simply does not display, throwing an behavior in the console. Hereβs what my custom loader looks like: ```javascript const customLoader = ({ src, width, quality }) => { return `https://example.com/images/${src}?w=${width}&q=${quality || 75}`; }; ``` And I am using the Image component like this: ```javascript <Image loader={customLoader} src="image.webp" alt="Example image" width={800} height={600} /> ``` The console logs show an behavior when it falls back to JPEG: `behavior: Image with src "image.webp" could not be found.` This is puzzling because the URL is correct and the image exists on the server. I've confirmed that the WebP image loads fine when accessed directly in the browser. I've also tried using different `width` and `quality` parameters, but the scenario continues. Has anyone else encountered a similar question when using a custom loader for the Next.js Image component with WebP images? Any tips on how to ensure that the WebP format is correctly loaded and displayed would be greatly appreciated! This is part of a larger API I'm building. I'm working with Javascript in a Docker container on Debian. Is there a better approach?