Jacobian
Jacobian

Reputation: 10832

How to fix "SyntaxError: let is a reserved identifier" in VueJs application

I'm getting this error message in my VueJs application:

SyntaxError: let is a reserved identifier

This error pops up in old browsers (for example, FireFox 3x). I know, that it can be solved somehow using babel, but I'm new to it and need a solution.

My package.json now contains this property:

"browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
]

And my babel.config.js is as simple as:

module.exports = {
    presets: ["@vue/app"]
}

What fixes should I add to make it work on old browsers?

Upvotes: 0

Views: 461

Answers (1)

SC Kim
SC Kim

Reputation: 600

Is likely because let is not supported in older browsers that doesn't support ES6. using var instead as a workaround by conditional check on browser's client type.

Link previous related thread: SyntaxError: let is a reserved identifier on firefox

Upvotes: 1

Related Questions