Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda