Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!