Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda