Images not displaying (Webpack bundler) - 404

PLEASE help us help you by writing a good post!

  • We need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot
  • Did you try Ask Netlify, our generative AI chatbot, before posting? It pulls info from Support Guides and recent solved forums posts.

The better the post - the faster the answer.


I´ve search for a solution to this with no luck, som I´m trying here:

My project dosn´t display any images. Not the static from html and css, nor the dymaically set in the js.
The paths are as from the index.html in the dist folder. I have tried prefixing path with “/”, no luck.

I use Webpack as bundler. (Not file-loader).
The site builds and deploys fine.

Netlify site name: main–merchorama.netlify.app
GitHub repos

@SimonADW A few things:

  1. This appears to be an assignment - if seeking to be a web dev you should self-solve

    The final project aims to showcase your proficiency in coding and design, integrating the skills acquired in the first semester, and the latest knowledge acquired during the second semester.

  2. The watch declaration in your webpack.config.cjs file means when I run npm run build that it never completes.

  1. You only have the one config file, and it’s set to development
  1. When running npm run build your dist folder does not contain any images:

    image

    Only files in the Publish directory (set in your Build configuration) will be deployed on Netlify

    You’ll need to google around to fix your build appropriately, I don’t work with webpack myself so cannot provide any tips.

2 Likes

Thank you kindly for answering in no time!