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 Giant panda
This is wrong. Unless you actually import an image you have to provide the size of it.
4 Replies
Giant panda
This is wrong. Unless you actually import an image you have to provide the size of it.
Answer
@Giant panda 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?
Giant panda
We don't know yet - it could be an accidental premature change for an upcoming feature or just oversight.