Error: Invalid src prop (<https://cdn.sanity.io/images/3i7e2etj/staging/02cacf40dcd5d1f5e57ca5e37b4ed09623335509-346x388.jpg?w=346&q=75&fit=clip&auto=format>) on `next/image`, hostname "<http://cdn.sanity.io|cdn.sanity.io>" is not configured under images in your  `next.config.js`
See more info: <https://nextjs.org/docs/messages/next-image-unconfigured-host>
I am getting this error. I have “ cdn.sanity.io ” in my next.config.js. It works if I use next/image directly in my next project, however it throws this error when I am importing a component that wraps next/image from an external component library. Does anyone have experience with this? I can see that the external library is using the wrong next.config.js but am not sure why. It looks as though it is just using the default next.config.js
Aug 9, 2021, 11:55 PM
I found that I didn’t have my peer dependencies setup correctly so it was using the incorrect next.config.