What is the process for integrating Internet Explorer 10 compatibility into a basic VueJs component?

I am facing an issue with a VueJs component that is not rendering in IE 10.

Context: The Vue component I am working on is a company events list with basic filtering and sorting functionalities. Unfortunately, IE10 support is required for this project. Even after trying to troubleshoot using babel, the problem persists.

The specific error message I am encountering is 'city' is undefined, and it occurs only in IE10.

For reference, you can view the relevant code on CodePen. I have included comments in the code to explain the situation. Here's a snippet of the JS (refer to CodePen for complete code and context):


/* Server rendered data */
var events = [...]; // Data for events
var eventsDesc = [...]; // Data for events sorted in descending order
var selectedStates = [...]; // Array of selected states
var selectedCities = [...]; // Array of selected cities

/* Vue instance creation below */
var app = new Vue({
   el: "#sg-events-wrapper",
   data: {
      message: "Hello Vue!",
      dateOrder: "ascending",
      selectedCity:"none",
      selectedState:"none",
      eventCities:selectedCities,
      eventStates:selectedStates,
      eventList: events,
      eventListDesc:eventsDesc,
   },
   computed: {
      eventsSorted:function(){
         if(this.dateOrder=="ascending"){
            return this.eventList;
         }
         else{
            return this.eventListDesc; 
         }
      },
   },
   methods:{
     isInStateAndCity:function(eventsCity,eventsState){
        ... // Method for visual filtering based on city and state selections
     }
   }
});

Steps taken for troubleshooting:

  • Attempted to use Babel despite original code structure.
  • Used babel-polyfill but saw no improvement.
  • Moved script tag content from HTML body to main JS file to check loading order - no change observed.

Potential cause identified: Speculation that IE10 may have issues with assigning object property values as done in the code. This is a hypothesis, and I am open to alternative solutions.

Attached are screenshots of the IE 10 console error and failed rendering in CodePen for reference.

If you have any suggestions or require testing assistance: I am willing to implement changes and provide feedback with recordings and console reports.

Answer №1

Sharing my solution here to help others who may encounter the same issue in the future as there is limited information available.

I discovered two main issues causing the problem. Firstly, my selectedCities and selectedStates arrays had a trailing comma which newer browsers overlook but causes errors in ≤IE10.

Additionally, I found an issue with VueJS using a new regex string that older versions of Internet Explorer do not recognize. To resolve this, you can either revert to an older version of VueJS or modify the regex. Detailed instructions can be found at the following source:

https://github.com/vuejs/vue/issues/7946#issuecomment-393713941

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 React-Route not displaying components

Below is the code snippet from my app.js file: <Router> <Header title="My Todos List" /> <Routes> <Route path="/about" element={<About />} /> <Route path="/" ...

Strange symbols were stored in the database after saving the textarea value

After submitting a form, text entered into a text area is being saved to my database. However, in one instance, certain characters such as • are appearing in the field. For example: • Text When retrieving the data from the database using Jav ...

Encountering a problem while deploying Vue to GitHub Pages due to issues with vue-router

I encountered some difficulties while deploying a Vue application built with vue-cli v3.0 to GitHub Pages. I utilized subtree to only deploy the dist folder to the gh-pages branch. Initially, the issue was that the assets were not being found, but I resolv ...

Using JavaScript to Toggle Visibility of Div Elements

Hi there! I'm having some trouble with a code that is supposed to show/hide div content based on the selection from a jump menu. Unfortunately, it's not working as expected. Here is the snippet of my code: JS: function toggleOther(chosen){ if ( ...

What is the process of manually loading webpack async chunks in the event that a dynamic import fails to load the file?

Async chunks in webpack can be created by using Dynamic Imports (for example: import('./ModuleA.js');). If the dynamic chunks fail to load, I want to retry loading them from another location. After grappling with the issue and delving into babel ...

Connect a Media Feed/ Stream to Video Element in Vue 3 Using the Composition API

I am attempting to connect a camera feed to a video element using Vue 3, but I am struggling to make even a simple example work. Can anyone point out what I might be overlooking? import { ref, reactive } from 'vue' let stream: any = reactive({}) ...

Fetching from the same origin results in a null comparison issue due to HTTP CORS restrictions

Encountering an issue where a simple same-origin fetch("fetch.xml") call fails, resulting in a console error message Access to fetch at 'http://127.0.0.1:8000/fetch.xml' from origin 'null' has been blocked by CORS policy: Th ...

Organizing the directory layout for the /profile/username/followers route in NextJs

I want to set up a folder structure for my website that can accommodate the URL /profile/username/followers, where the username will be different for each user. The proposed folder structure is as follows: pages -- profile -- [username].js Curren ...

Dealing with errors when implementing an Angular 2 route guard that returns an Observable of type boolean can be a

My route guard is implemented as follows: @Injectable() export class AuthGuard implements CanActivate { constructor(private router: Router, private authenticationSvc: AuthenticationService) { } canActivate(): Observable<boolean> { return this. ...

Exploring SVGO CLI: A guide to inspecting SVGs across various directories

Currently, I am utilizing the SVGO CLI script to transform some icons within my project. Specifically, these icons are located in two separate folders - assets/icons/dark-mode and assets/icons/light-mode. My goal is to navigate through both of these folder ...

What is the best way to convert Arabic language HTML into a PDF document on the client side?

Utilizing jsPDF and vue js, I successfully implemented a feature to export PDFs. However, I encountered an issue with Arabic characters not displaying properly. Can anyone provide assistance in resolving this problem? ...

"V-model does not dynamically change when selecting an option in the dropdown

I have encountered a small issue that I am struggling to resolve. Recently, I created a select box which you can view here: https://codepen.io/spqrinc/pen/wvaqrPj <div id="app"> Selected value: {{item.picked}} <hr /> <select v-model="it ...

Error: The function "this.state.data.map" is not defined in ReactJS

class Home extends Component { constructor(props) { super(props); this.state = { data: [], isLoaded: false, }; } componentDidMount() { fetch("https://reqres.in/api/users?page=2") .then((res) => res.json ...

Focusing on the active element in Typescript

I am working on a section marked with the class 'concert-landing-synopsis' and I need to add a class to a different element when this section comes into focus during scrolling. Despite exploring various solutions, the focused variable always seem ...

What causes my Bootstrap 5 popover to no longer open on focus when I reopen the modal it is attached to?

I am facing an issue with my Bootstrap 5 modal and the popovers that are attached to it. On hovering over a button in my HTML, a popover appears asking 'Are you sure?' and instructing the user to click the button to proceed. Clicking the button ...

Ways to discreetly conceal forward and backward buttons in the v-pagination component of Vuetify

Is there a way to remove the previous and next buttons from v-pagination in Vuetify? Here's my code snippet- <v-pagination v-model="page" :length="pageCount" :total-visible="8" color="primary" /> ...

Create an express server that can stream mp3 files with the functionality to easily skip forward or rewind

My express server is set up to either download or stream an mp3 file, and here is the code: const express = require('express'); const fs = require('fs'); const app = express(); app.use('/mp3', express.static(__dirname + &apo ...

Validation of phone numbers based on country codes

How can I validate phone numbers based on the selected country in Angular? Are there any Angular packages specifically for this task? I've attempted to use regex, but it only works for certain countries. I need a solution that can validate mobile an ...

Is there a way to selectively display items that are grouped with children only?

I am currently experimenting with Vuetify and exploring the usage of v-list-group. I am curious to know if there is a way to prevent the grouping behavior for items that do not have any children? <template> <v-layout fill-height> ...

Can the optionsText be shown while saving the optionsValue in a dropdown menu?

Here is the code snippet I am currently working with: var model = function() { this.nameSomething = ko.observable(''); this.nameId = ko.observable(0); }; var vm = (function() { var myList = [{ id: 1, type: 'foo1'}, { id: 2, ...