Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

next/image Un-configured Host with IP domain

i built site using NextJS and image is host at other dev server that run with IP. THe file is public accessible by the image path :
http://xxx.xx.xxx.xxx:8080/storage/user-profile/61d41e2b05de9_WhatsApp%20Image%202022-01-02%20at%2021.46.03.jpeg
But I receiving the following error:
Error Message

I added following code to the next.config.js :

module.exports = {
  images: {
    domains: ["http://xxx.xx.xxx.xxx:8080"],
  },
};

even tried with

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

module.exports = {
  images: {
    domains: ["http://xxx.xx.xxx.xxx:8080"],
  },
};

both return the same error as shown in above screenshot

Any help is greatly appreciated

>Solution :

domains should not have http:// or https:// or the scheme included

You may use the hostname of your source image url

module.exports = {
  images: {
    domains: ['cdn.yoursite.com'],
  },
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading