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

91
Views
Img wont show Reactjs

New react developer, i'm using webpack and trying to load image, but it wont show it and it is not giving me any error, any idea ?

webpack:

module.exports = {
  module: {
    rules: [
      {
        test: /\.(ts|js)x?$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
        },
      },
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader'],
      },
      {
        test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
        loader: 'url-loader?limit=100000',
      },
    ],
  },
  resolve: {
    extensions: ['*', '.js', '.jsx', '.tsx', '.ts'],
  },
};

import Immage from '../../icons/MicrosoftTeamsImage.png';


          <img src={require('../../icons/MicrosoftTeamsImage.png')} alt="icon" />


also tried like this:

<img src={Immage} alt="some example image" alt="icon" />

it shows like this:

enter image description here

those i installed like this: yarn add --save file-loader url-loader

edit: I checked network tab and status is 200, but it shows Request URL: http://..../[object%20Module] i tried to fix it like this <img src={require('../../icons/MicrosoftTeamsImage.png').default} alt="icon" /> and now it says : Request URL: http://..../29691089ca26d06beb2854d687a560cf.png but still image wont show

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Take the directory icons that contains the image and put it inside the src directory.

Then adjust the path of the image to be as:

import Immage from '../icons/MicrosoftTeamsImage.png';

And then use this syntax:

<img src={Immage} alt="some example image" alt="icon" />
about 4 years ago · Juan Pablo Isaza Report
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!