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

132
Vistas
Simple js function not defined in view despite file compiled and referenced

I am trying to use a simple js function in a view and it doesn't seem the view is seeing the script I am referencing.

testFile.js:

export const simpleFc = (input) => {
    alert(input);
}

It build without error and I can see the resulted build js file and it's content is correct. I have no other js error in console.

I am including it in the view:

<script src="~/dist/js/testFile.build.js"></script>

Then I am trying to use it:

<script type="text/javascript">
    simpleFc('show alert');
</script>

I am getting an error saying: simpleFc is not defined.

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