lorenzodejong / next-sanity-image

Utility for using responsive images hosted on the Sanity.io CDN with the Next.js image component.
MIT License
149 stars 20 forks source link

Update to work with Next 12 and image transformations #31

Closed wenche closed 2 years ago

wenche commented 2 years ago

👋

The fix for Next 12 does not remove all the warnings. If you use image transformations, you'll still see a lot of warnings because the imageBuilder returns a w instead of a width parameter.

We've discussed this with Sanity, and they suggest to manually add the width as a workaround that satisfies both Next.js and doesn't effect the image from Sanity.

Screenshot 2021-12-01 at 14 53 23

lorenzodejong commented 2 years ago

This warning does not seem to occur anymore in my test cases using any version of Next.js 12.x. Could you perhaps provide a reproducible test case so we can see if we can solve this issue?