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

164
Vistas
VUE npm module wrong file path source

so I have my own npm module made by vue js (REPO-A), let's say I install this module on my project (vue js too) (REPO-B). And I use an avatar component from that module, previously I have added an @error handler on my <img> tag like this to make the image default when something went wrong with the image resource,

handleErrorImage(e) {
  if (e.type === "error") e.target.src = require("../assets/defaultImage.svg")
}

it works as expected if I run on REPO-A and get the defaultImage.svg with the right path, but it's not working if I run on REPO-B, and I tried to look at the network panel, I think if I run on REPO-B the resource of the defaultImage.svg was the wrong path like this

RUN ON REPO-A enter image description here

RUN ON REPO-B enter image description here

the question is, how to make the defaultImage.svg path load correctly if the avatar component is used in REPO-B, thanks in advance

about 4 years ago · Juan Pablo Isaza
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