#Why do i get the "missing required width property" error when i'm loading static images?

17 messages · Page 1 of 1 (latest)

high pasture
#

The documentation says that loading static assets from the public folder doesn't require you to specify height or width as it will be predetermined

chilly wigeonBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

high pasture
scarlet surge
high pasture
#

noted, thank you

charred stratus
high pasture
#

i specified the width, but it's still asking me to get the height

charred stratus
#

yes both width and height are required unless you import the image

#

import image from "./path/to/image.png"

high pasture
charred stratus
#

just put the image in the same folder and import it statically

high pasture
charred stratus
chilly wigeonBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer
charred stratus
#

in a typical nextjs app, you only need to use the public folder for a small number of things. images, fonts and such need not be stored there

high pasture