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

193
Vistas
Why does ES6 JavaScript run locally from VS and not from same browser after deployed to server

I have built a .NET Core application with VS2019. In the application's JS files, I have used the let keyword in a few places. Example let x = 2 When debugging I have VS set to run the version of Chrome installed on my desktop (using file.js) and all works well. Once I deploy the application to a server (and use file.min.js), the browser no longer recognizes the let keyword.

Any idea why using the same browser, it down grades to ES5 when deployed, yet runs ES6 correctly locally?

Update:
To recreate this issue use the Market Place extension BundlerMinifier

When minifying the following code, variables of the same name are used in the transformation that leads to bugs in the JavaScript minimized file.

Within a .js file create an ajax call to retrieve some data. upon success of data retrieval, loop through an array from within the returned value.

Use this language for the loop for(let accts of data.accounts)

Current behavior:
for(let accts of data.accounts) minimizes into for(let t of t)
Both the variable and the array property end up with the same name.

Expected behavior
for(let accts of data.accounts) minimizes into for(let a of b)
The variable and property should have different names

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I believe I have found the answer to my own question.

It seems a bug may be present in the code of the minimize plug in I am using.

I have created a bug issue in the GitHub repository that can be found here: Issue with minimize transforming to object to the same name #580

In short, the true issue was not with the let keyword, but that the variable it was calling had the same name as another within the same scope.

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