<Image
src={"http://localhost:3000/images/img.jpeg"}
layout="fill"
objectFit="cover"
width={"100%"}
height={"100%"}
/>
The error is :
How do I solve ?
<Image
src={"http://localhost:3000/images/img.jpeg"}
layout="fill"
objectFit="cover"
width={"100%"}
height={"100%"}
/>
The error is :
How do I solve ?
The error says that, the url that you are using for the Image is not from a trusted hostname(domain).
You just need to add that hostname or domain inside your next.config.js file.
Follow the following steps :
module.exports = {
images: {
domains: ['assets.example.com'],
},
}
This must solve your problem.
For more details you can read more on this page :
next.config.js