Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Webpack 5, Images only load broken

I am trying to display images on the screen but the only thing i get is this
broken image

I followed several different guides but they all lead me back to this broken image or no image at all. I have tried svg, jpg and png format but none of them show currectly. I got my images from flaticon and i saved them as pngs and jpgs. They didn't work, i made my own jpg, that didn't work. I then tried svg but they show me this message
Svg Error

Here is the code i have in webpack for module loading

module: {
    rules: [
        {
            test: /\.scss$/,
            use: ['style-loader','css-loader','sass-loader'],
        },
        {
            test: /\.(png|svg|jpg|jpeg|gif)$/i,
            type: 'asset/resource',
        },
    ]
},

here is the code i have for importing the image in js

//import menuburger from './images/test.jpg'
const menuburger = require("./images/menu-burger.svg");
//import add from './images/add.svg'
//import menuleft from './images/angle-left.svg'


const main = async () => {

const mb = document.getElementById('MenuBurgerIMG')

mb.src = menuburger;

html source

<div class = "Menem" id = "MenuBurger">
     <img id  = "MenuBurgerIMG" alt = "" style ="width: 100%;height:100%;">
</div>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!