Error: Image with src "/google.png" is missing required "width" property.
Answered
C0ffee_39 posted this in #help-forum
In documentation https://nextjs.org/docs/app/getting-started/images#local-images in section "Local images" says that if image is located in "public" folder, you can use src="google.png", and an example is given. I do exactly the same thing, but get an error. Here is my code:
import Image from "next/image";
export function MISIS_Logo() {
return <Image src="/google.png" alt="" />;
}
Answered by Asian black bear
This is wrong. Unless you actually import an image you have to provide the size of it.
4 Replies
Asian black bear
This is wrong. Unless you actually import an image you have to provide the size of it.
Answer
@Asian black bear This is wrong. Unless you actually import an image you have to provide the size of it.
Thanks, I got it. Then why is it written differently in the documentation?
Asian black bear
We don't know yet - it could be an accidental premature change for an upcoming feature or just oversight.