Description
Describe the bug
Images generated by next/image 1) are not in optimized webp format despite using webp-compatible browsers (the resultant format is jpeg which is the original image format) and 2) have a strange 301 redirect issue. I tested this in the latest versions of Firefox, Chrome and Safari and error number 2 manifests slightly differently in each browser - in the worst case (Firefox), the transferred 301 file have the same size as the original image, leading to x2 KBs being transferred (and visually-apparent slowness in loading images) whereas in the best case (Safari), the 301 files seem to have 0Bs.
I also tested this both in localhost and in Vercel and none of the above two errors appear in those scenarios.
The image below shows both of these errors in Firefox browser:
To Reproduce
Steps to reproduce the behavior:
- Go to https://marketing-proxy-two.netlify.app/
- Open Devtools
- Click on Network tab and click on Images to only see image resources
- Refresh and see errors as described above
Expected behavior
Images should be in optimized webp formats and should not have a 301 redirection as in the below image (which is from localhost).
Versions
- Next.js: v11.1.2
- @netlify/plugin-nextjs: v3.9.0
- @netlify/build: v18.13.12
- node: v16.11.0
- yarn: v1.22.10
If you're using the CLI to build
- OS: [e.g. macOS, Windows] macOS Catalina Version 10.15.7