npmreactjs95% confidence\u2191 65

Got an error Invalid src prop ('here is a link') on `next/image`, hostname "localhost" is not configured under images in your `next.config.js`

Full error message
I am using the Image component from Next.js (it's a new feature of Next.js). I've tried to give the source URL:

{`${API}/user/photo/${blog.postedBy.username}`}

But it shows me this error. I also make changes in my next.config.js as

module.exports = {
    images: {
      domains: ['localhost'],
    },
  }

but nothing works for me. Please help if you know anything about this.

Yes, I finally got the answer. Make loader function to load it from the destination of the image. const myLoader=({src})=>{ return `${API}/user/photo/${blog.postedBy.username}`; } Use this loader function the loader attribute of an Image tag. <Image loader={myLoader} src={`${API}/user/photo/${blog.postedBy.username}`} width={500} height={500}/> This works for me perfectly

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/0b7b76c60b5ad137fc72321d5cebe3530f3dd4af32bf2218b55b32964b0225d9
hash \u00b7 0b7b76c60b5ad137fc72321d5cebe3530f3dd4af32bf2218b55b32964b0225d9
Got an error Invalid src prop (&#39;here is a link&#39;) on… — DepScope fix | DepScope