In Internet Explorer 11, an error with code script5017 is triggered when attempting to utilize fortawesome

Below this statement, you can find the console error message:

script5017 syntax error in regular expression

chunk-vendors.js (96290,5)

chunk-vendors.js

!*** ./node_modules/core-js/modules/es.regexp.constructor.js ***!
...
result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); // line 96290
...

main.js

import 'core-js/stable'
import "core-js/es/symbol";
import 'regenerator-runtime/runtime'
import 'intersection-observer' // Optional
import Vue from 'vue'
import App from './App.vue'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
// fontawesome 6.1.1
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';

// Import Bootstrap and BootstrapVue CSS files (ensure correct order)
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

// Use BootstrapVue globally
Vue.use(BootstrapVue)
// Optionally install BootstrapVue icon components plugin
Vue.use(IconsPlugin)

Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')

library.add(
  fas,
  far
)

I have noticed some conflicts between BootstrapVue and fortawesome. Sometimes it fails to load properly while using them together, especially in Chrome. To address this issue, a specific statement has been included in this source code.

However, I am uncertain why the script 5017 error occurs when loading JavaScript. Could this be related to a core-js or BootstrapVue problem?

The versions I used are:

@fortawesome/fontawesome-common-types
6.1.1

@fortawesome/vue-fontawesome 2.0.6

core-js 3.20.2

bootstrap 4.6.1

bootstrap-vue 2.21.2

Answer №1

It appears that your current implementation includes the usage of Font Awesome 6, a version that no longer supports IE11. If necessary, you have the option to revert back to Font Awesome 5, which does support IE11.

Your package.json should be updated as follows:

{
  "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"
  }
}

To apply these changes, run either yarn or npm i.

Note the specific versions required for compatibility: "core" <1.3, *-icons =5.15.4, and vue-fontawesome <1, corresponding to "Font Awesome < 6".

The inclusion of the resolutions section may not be mandatory, but it was essential in my case to ensure the downgrade below version 1.3.0. To verify the installed version, check

node_modules/@fortawesome/fontawesome-svg-core/package.json
.

The root cause lies in the fact that IE11 lacks support for Unicode RegExes, upon which Font Awesome 6 depends. Despite attempts with

@babel/plugin-proposal-unicode-property-regex
, I was unsuccessful in resolving this issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with Angular's ngOnChanges Lifecycle Hook Preventing Function ExecutionWhen attempting to run a function within Angular's ngOn

In the midst of my evaluation process to ensure that specific values are properly transmitted from one component to another using Angular's custom Output() and EventEmitter(), I am encountering some issues. These values are being sent from the view of ...

Unable to trigger AJAX Complete Handler

Upon completing extensive backend work on my web application, I discovered that the GetMeasure Request was taking up to 10 seconds to finalize. To prevent confusion for potential users, I decided to implement an overlay so that they would not be left stari ...

Managing the verification of data existence in the ExpressJS service layer or controller

Working on a medium-sized website, I realized the importance of writing maintainable code with a better project structure. After stumbling upon this insightful article and some others discussing the benefits of 3-layer architecture, I found the concept qu ...

I need to position a Vue component at the top of the page for a specific view only

How can I ensure that the component SiteHead only appears at the very top of the HomeView page, above the SiteNavigation component? If I place the SiteHead component within the HomeView.vue code, it ends up below SiteNavigation. Here is my App.vue code: & ...

Is there a way to use flexbox in a grid to center only a specific tab from MUI?

I am working with an array of tabs and encountering a layout issue. The tabs need to share the available space when there's more than one tab, but when there's only one tab, it should be positioned in the middle of the column. How can I address t ...

Creating a Pyraminx using triangular shapes

Attempting to create a Pyraminx, a tetrahedron made up of multiple triangles, through my coding. The approach I am taking may not be very precise. You can find my code here: https://codepen.io/jeffprod/pen/XWbBZLN. The issue I'm facing is manually in ...

Gathering data from a webpage containing a table populated by JavaScript

I need to extract data from this webpage in order to process generation data with a parser later. The issue I'm facing is that the table on the page is populated by multiple scripts making requests to another server. When using Beautiful Soup to scra ...

I aim to utilize lodash filter to swap out any null values with zero

let x = [{'abc': 1, 'qwe':2},{'abc': 2, 'qwe':2},{'abc': 5, 'qwe':null}, {'abc': 4, 'qwe':null}], let result = _.chain(x) _.groupBy(qwe) _.map ...

Pattern matching tool for identifying React components with an unlimited number of properties

Currently diving into MDX and experimenting with Regex to extract details on React components from Markdown files. The regex pattern I'm aiming for should: Detect all types of React components This includes identifying the opening tag <Component ...

Possible scope problem causing AngularJS image preview not showing up in ng-repeat loop

I came across this question and made some modifications. It works well when used outside of the ng-repeat. However, I'm facing issues when trying to use it within my repeat loop; the image.src does not update. I believe this is more related to the sc ...

Retrieving data from the chosen selection in AngularJS

My current task involves extracting the URL from the selected option and assigning it to the ng-model of the select element. Here is the HTML code snippet: <select ng-model="ddValue1.value"> <option ng-repeat="d in ddOptions1" value="{{d.val ...

The Countdown feature is currently only functioning on the initial button and not on any of the other buttons

I could use some assistance. I have a download button with a countdown, but there seems to be an issue with the button's functionality. It only works on the first button, or if the second button is clicked first, it starts the countdown on the first b ...

Employing promises for retrieving ajax data

I've been struggling to make sure my code waits for an ajax call to finish before proceeding, as I need data in an array first. No matter what I try, it seems like promises might be the best solution in this scenario. Currently, the ajax call still oc ...

I am encountering a TypeError that says "Cannot read properties of undefined (reading '$router')". Can anyone explain what this error means and provide guidance on how to resolve it?

$Happy New Year! I'm currently facing an issue with setting up a redirect after retrieving an authentication token. The console keeps throwing a "TypeError: Cannot read properties of undefined (reading '$router')" error, and the user is not ...

Canvas is unable to duplicate image content

I am trying to duplicate a PNG captcha image in order to remove its transparency so that the captcha resolver (ocrad.js) function can work properly. However, I am facing an issue where the duplicated captcha image is being moved and resized. How can I ke ...

Changing the <style> dynamically within a Single File Component

Can the content within a scoped in a Single File Component be dynamically updated? ...

Displaying dynamic text using radio buttons utilizing React

Currently, I am in the process of developing a multiple choice quiz where each question is presented with various options displayed as radio buttons. My main objective is to show specific text related to the option selected by the user when they make a ch ...

angular trustAsHtml does not automatically insert content

Two divs are present on the page. Upon clicking button1, an iframe is loaded into div1. The same applies to button2 and div2. These iframes are loaded via ajax and trusted using $sce.trustAsHtml. This is how the HTML looks: <div ng-bind-html="video.tru ...

Replace a node package with a custom solution

Within my package.json, I have specified a dependency as "protractor": "2.1.0". This particular package is dependent on another package called "jasminewd2": "0.0.5". The behavior of the jasminewd2 package is something that I want to modify. So, I decided ...

Utilize ng-click in conjunction with an AngularJS directive

I'm encountering an issue while trying to create a directive and attaching ng-click with the template. Despite my efforts, when clicking on the template, it fails to log the statement from the scope.scrollElem function. The directive has been success ...