Next.js Discord

Discord Forum

I imported images from local dir like images/images.jpg and create a card but it is not working help

Answered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
what should I do
Answered by riský
if you have
next.config.js
public
  /small-orange.jpg

you can access at /small-orange.jpg
View full answer

12 Replies

Barbary LionOP
those are codes
store the images in the public folder and then use them via href (root of publich is root to import)
Barbary LionOP
ok I will try
thanks for reply
@riský store the images in the `public` folder and then use them via href (root of publich is root to import)
Barbary LionOP
I got this now : The requested resource isn't a valid image for /public/small-orange.jpg received text/html; charset=utf-8
if you have
next.config.js
public
  /small-orange.jpg

you can access at /small-orange.jpg
Answer
Barbary LionOP
it works
I can not beleive that
no problem, enjoy the rest of your day 🙂
@riský no problem, enjoy the rest of your day 🙂
Barbary LionOP
you too