Development/React.js

next/image hostname error

moretz0921 2022. 5. 18. 20:17

 

Image 를 사용시에 hostname 관련 이슈가 발생시 해결법은 next.config.js에 아래와 같이 도메인을 등록해주면 된다. 

 

module.exports = {
  ...
  images: {
   	domains: ["cdn.pixabay.com"]
  },
  ...
}

 

출처

https://velog.io/@broccoliindb/nextimage-hostname-error

 

next/image hostname error

hostnameImageImage 를 사용시에 hostname 관련 이슈가 발생시 해결법은 next.config.js에 해당 설정을 통해 아래와 같이 도메인을 등록해주면 된다. 아래 예는 github avatar 도메인과, 로컬테스트용 도메인인 l

velog.io

https://github.com/vercel/next.js/discussions/18311

 

next/image hostname error · Discussion #18311 · vercel/next.js

I get the following error using an image with an absolute url: Invalid src prop ({REDACTED URL}) on 'next/image', hostname is not configured under images in your 'next.config.js'. N...

github.com

https://nextjs.org/docs/messages/next-image-unconfigured-host

 

next-image-unconfigured-host | Next.js

next/image Un-configured Host On one of your pages that leverages the next/image component, you passed a src value that uses a hostname in the URL that isn't defined in the images.domains config in next.config.js. Add the hostname of your URL to the images

nextjs.org