[Vuejs]-When using fortawesome, script5017 syntax error occurs in internet explorer 11

0👍

It looks like you’re using Font Awesome 6, which does not support IE11 any more.
You could downgrade to Font Awesome 5, which does.

Your package.json should look something like this:

{
  "devDependencies": {
    "@fortawesome/fontawesome-svg-core": "1.2.36",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/vue-fontawesome": "^0.1.10",
  },
  "resolutions": {
    "@fortawesome/fontawesome-svg-core": "1.2.36"
  }
}

Then update with yarn or npm i.

Note versions "core" <1.3 + *-icons =5.15.4 + vue-fontawesome <1, which correspond to "Font Awesome < 6", as far as I could tell.

The resolutions part might not be necessary, but I had a hard time convincing yarn to actually downgrade below 1.3.0, for whatever reason.
You might want to check node_modules/@fortawesome/fontawesome-svg-core/package.json to confirm the installed version.

The issue is indeed the missing support for Unicode RegExes in IE11, which Font Awesome 6 relies on.

I’ve spent some time trying to make it work with @babel/plugin-proposal-unicode-property-regex to no success.

Leave a comment