MIcrosoft Edge issue: [vue-router] Failed to resolve async component default: SyntaxError: Expected identifier, string or number



  • My new app runs without errors in Chrome and other browsers, but it generates an error in Microsoft Edge.

    [vue-router] Failed to resolve async component default: SyntaxError: Expected identifier, string or number
    eval code (1557) (17,5)

    [vue-router] uncaught error during route navigation:
    eval code (1557) (17,5)

    [object Error]: {description: “Expected identifier, string or number”, message: “Expected identifier, string or number”, number: -2146827260, stack: “SyntaxError: Expected identifier, string or number at ./node_modules/vue-plyr/dist/vue-plyr.mjs (http://localhost:8080/vendor.js:2878:1) at webpack_require (http://localhost:8080/app.js:854:12) at fn (http://localhost:8080/app.js:151:13) at eval code (eval code:3:22) at ./node_modules/babel-loader/lib/index.js?!./node_modules/@quasar/app/lib/webpack/loader.auto-import.js?kebab!./node_modules/vue-loader/lib/index.js?!./src/components/Player.vue?vue&type=script&lang=js& (http://localhost:8080/0.js:11:1) at webpack_require (http://localhost:8080/app.js:854:12) at fn (http://localhost:8080/app.js:151:13) at eval code (eval code:2:22) at ./src/components/Player.vue?vue&type=script&lang=js& (http://localhost:8080/0.js:115:1) at webpack_require (http://localhost:8080/app.js:854:12)”}

    The only file I have so far with async in it is this:

    import Vue from 'vue'
    import axios from 'axios'
    import convert from 'xml-js'
    export default async (/* { app, router, Vue ... } */) => {
      await axios.get('https://www.loatoday.net/feed/mp3')
        .then(function (response) {
          Vue.prototype.$xml = convert.xml2json(response.data, { compact: false, spaces: 1 })
        })
        .catch(function (error) {
          console.log(error)
        })
        .then(function () {
          // always executed
        })
      let xml = JSON.parse(Vue.prototype.$xml)
      let length = xml.elements[0].elements[0].elements.length
      let title = ''
      let description = ''
      let mp3 = ''
      let feed = []
    
      for (let i = 21; i < length; i++) {
        title = xml.elements[0].elements[0].elements[i].elements[0].elements[0].text
        description = xml.elements[0].elements[0].elements[i].elements[4].elements[0].cdata
        mp3 = xml.elements[0].elements[0].elements[i].elements[6].attributes.url
        feed.push({
          "id": (i - 19),
          "title": title,
          "description": description,
          "mp3": mp3
        })
      }
      Vue.prototype.$image = xml.elements[0].elements[0].elements[4].elements[0].elements[0].text
      Vue.prototype.$title = xml.elements[0].elements[0].elements[4].elements[1].elements[0].text
      Vue.prototype.$url = xml.elements[0].elements[0].elements[4].elements[2].elements[0].text
      Vue.prototype.$description = xml.elements[0].elements[0].elements[2].elements[0].text
      Vue.prototype.$feed = feed
      return feed
    }
    
    

    The feed in question is a podcast feed. How can I fix this?


Log in to reply