loading IMAGES from JSON file, path is not working - file-loader #19376
-
Hi, I'm having an issue with images. Does anyone know how to help me? next.config.js
JSON
React Component
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I can't believe it was so simple, it is kind of embarrassing but I'll write the solution here in case someone needs in the future. I was using my source image folder on config.yml, like: So I discovered that it needs to be a folder inside the public folder, so now I'm using: |
Beta Was this translation helpful? Give feedback.
-
So the solution is to move the folder from ./src folder to public folder ? |
Beta Was this translation helpful? Give feedback.
I can't believe it was so simple, it is kind of embarrassing but I'll write the solution here in case someone needs in the future.
I was using my source image folder on config.yml, like:
media_folder: "media/uploads"
So I discovered that it needs to be a folder inside the public folder, so now I'm using:
media_folder: "public/images"
public_folder: /images