Issues with rendering Vue components in Internet Explorer have been encountered

While my Vue.js components work perfectly in Edge, Chrome, Firefox, and other browsers, they fail to render in IE11. I utilize gulp for project building and Babel for compiling es6 into es5.

.babelrc

{
 "plugins": ["@babel/plugin-syntax-dynamic-import"],
  "presets": [
    ["vue", {"eventModifiers": false}],
    ["@babel/preset-env",{"useBuiltIns": "entry"}]]
}

Could it be that I require additional presets?

Answer №1

To effectively utilize the @babel/present-env preset, it is necessary to specify the browsers that the build script should cater to.

One way to achieve this is by creating a browserlist with the specific browsers or support percentages you wish to target - https://babeljs.io/docs/en/babel-preset-env#targets

If your goal is to support modern browsers along with IE11 (which typically has a usage percentage above 2%), you can implement the following configuration:

{
  "browserslist": [
    "> 2%"
  ]
}

Answer №2

Since IE11 does not support IE11, you will need to make changes to your

.babelrc (Babel 7)

{
  "presets": [
    [
      "@vue/app",
      {
        "targets": {
          "ie": "11"
        }
      }
    ]
  ]
}

Please let me know if this solution works for you. If you are using Babel 6, refer to Alen Genzić's response.

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

What is the method to choose a checkbox based on its id and then activate setChecked()?

I am creating a unit test to verify that a method gets called when a checkbox is clicked. For this test, I am utilizing ElementUI. Below is a snippet from the component template: <template lang="pug"> el-card el-checkbox#checkAllChec ...

when the window is scrolled a certain amount, use jQuery to scroll back in the opposite direction

Using jQuery for Background Image Position: $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 50) { $(".class").addClass("bgposi"); // $(".top").addClass("fixd"); // $(".logo").addClass ...

Obtaining JSON responses with NodeJs: A beginner's guide

I am currently utilizing NodeJs and MongoDb for my back-end services. Within my collection, there are various documents with fields named _id and Name. My goal is to receive the output in JSON objects structured as follows: [ { Name:"Paul" }, ...

Exploring JavaScript Regular Expressions in Internet Explorer 11

I am attempting to eliminate all non-digit characters from a string using JavaScript. While this code works properly in FF and Chrome, it does not work in IE11 and no characters are removed. var prunedText = pastedText.replace(/[^\d\.]/g,""); ...

What steps can be taken to troubleshoot this AngularJS code?

When errors occur within Angular, debugging becomes quite challenging for me. Here is the code snippet I am working with: <script> var my_app = angular.module("campaign_listing", ['$http']); var controllers = {}; controllers.ca ...

Steps for adding a JSON object to an unordered list

After receiving data from a web server, I created a JSON object using the code obj = JSON.parse(data). This object contains information about dinosaurs such as their name, group, diet, and period. This is what the JSON object looks like: [{"name":"Stauri ...

The issue of event emission not being registered for custom filters in vue-tables-2

I keep encountering this issue: "TypeError: Event.$emit is not a function" every time the watcher triggers. Even though I imported the Event object in my main.js file and can log it to the console, I am using a named prop due to having three different cli ...

Vue.js 3 - "The 'createStore' export could not be located in the 'vuex' package"

Whenever I run my app, I encounter the following error: WARNING Compiled with 1 warnings ...

What causes JavaScript Date to not update correctly during daylight savings time changes?

The Enigma of JS Dates My Initial Expectations In my Node applications, I have implemented functionality to send broadcasts to platforms like Facebook Messenger. Users subscribe to receive these broadcasts at a specific time, for example, 2pm daily. Whe ...

Processing JSON in PHP after an AJAX POST request

In the scenario where JavaScript is used to make an ajax request: index.js- var dataFeedback = $("#feedback_popup_message_body").val(); var jsonObj = JSON.stringify({dataFeedback: dataFeedback}); $.ajax({ url: "index.php", type: 'POST' ...

Executing a Javascript function repeatedly

Here is a sample JavaScript function: function f1() { alert("HI"); } I have two different locations where I am calling the same JavaScript function: <input type="submit" id="btn1" onclick="f1()"/> <input type="submit" id="btn2" onclick="f1 ...

Whenever Ionic is paired with LokiJS, it consistently results in the error message: "ionic.bundle.js:26794 TypeError: Cannot read property 'insert' of undefined"

Having faced numerous issues with SQLite, I decided to explore LokiJS as an alternative solution for my Ionic app. However, even with LokiJS, I encountered challenges. Currently, I have a simple code that should function smoothly: .controller('Proje ...

In Vue js, where is the best place to incorporate something similar to a 'base.html' template?

My transition from a Flask backend without a front end framework to Vue.js (with no chosen backend yet) has me considering how to structure my project. Previously, I would create a 'base.html' file that contained all the necessary HTML code, depe ...

Is it possible to invoke a private function within the same object in JavaScript?

EDIT: I don't think this question is the same as the one linked. I understand how to retrieve a private variable (as seen in the code below), but my question was about invoking a private function within the same object. I'm struggling to find re ...

AngularJS: accessing remote systems - a guide

I am looking to explain my objective clearly I need guidance on how to establish a remote desktop connection from my Angular.js application to a windows application running system. The server I am using is Google App Engine. My current ideas: The Windo ...

What is the best way to access the items generated within a v-for loop?

Currently running a little experiment as I dive into VueJS. My main query revolves around how to access the marker object generated through the v-for loop. <gmap-marker :key="index" v-for="(m, index) in markers" :icon="m.icon" : ...

Dragging and dropping inline elements in CK Editor causing a problem

I have successfully developed a custom plugin, as illustrated in the image. I am able to insert objects with the class "placeholder" like this: <span class="placeholder">Loop-ANS(Q2)</span>. https://i.sstatic.net/jrNX0.png This inli ...

Developing an E-commerce Cart feature using AJAX, HTML5, and Jquery exclusively

I am looking to develop a Cart System using solely HTML5, AJAX, and Jquery without incorporating any server side scripting language like PHP or ASP.NET. The scenario I have is: "A designated HTML division displaying added products with their Name, Price, ...

How can I ensure that my script reruns when the window is resized?

Clearly, the question is quite straightforward... I have a script that is drawing graphics across the window. Currently, when I resize the window (e.g., make it full screen), the script only responds to the original size of the window. It should refresh a ...

Transforming a collection of string arrays into a tree format, as well as reversing the process to convert the tree back into a list of string arrays

I am working with a sorted array containing lists of string arrays: 0:['BS', 'MS','KHB', 'CCBPO'] 1:['BS', 'MS','KHB', 'HBPO'] 2:['BS', 'MS','KHB' ...