I was working on my Next.js project and while running it locally html img tag worked okay. While building, I got a warning, to change it to Image component from Next.js
So I did, but now I get a warning:
Error: Invalid src prop (https://image.ceneostatic.pl/data/products/10813131/i-dixit.jpg) on
next/image, hostname "image.ceneostatic.pl" is not configured under images in yournext.config.jsSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-host
I read in the documentation that solution is to add a domain to next.config.js. But 2 problems occurs to me here:
Even if I specify a domain like this, it doesn't work
module.exports = { images: { domains: ['image.ceneostatic.pl'], }, };
I have my project connected to MongoDB, where are stored links to the images. What's more, I want an user to pass a link, while creating a new entry. So I don't want to have hard-coded domains, as I don't know which img an user will use.
Is there a way to omit domains list or a walk-around to use tag?
Thanks!
next.config.js?next/imagecomponent directly.