I recently started making websites with Next.js, and I have been using a mix of Image
and img
for various use cases.
I know that Image
is built-in to Next.js
and is the better choice, but there are scenarios where I do not know the size or the ratio of the images I am loading, and thus the img
seems to better suit.
During my recent project, this is the first time my npm run build
command is failing with:
1:7 Error: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.
My other Next.js projects do not fail this way, and use the same next.config.js
. Does anyone know why this is happening?