Vue 3 do not work on IE SCRIPT1002: Syntax error

I am not sure what is wrong but i am getting an error on IE

SCRIPT1002: Syntax error
chunk-vendors.js (1398,1)

If i create a new project with vue 3 and adding socket.io-client module to main.js, it wont work on IE:

here is my main.js

import Vue from 'vue'
import App from './App.vue'
import socket from 'socket.io-client';

Vue.config.productionTip = false;

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

here is my babel.config.js:

module.exports = {
    presets: [
        '@vue/cli-plugin-babel/preset'
    ]
}

if i remove socket.io-client, the IE display correct the “Welcome” page but, once i adding back the module socket.io-client, the IE give the blank page, can anyone help me with that?

vue.config.js

module.exports = {
  transpileDependencies: [
    'socket.io-client',
    'engine.io-client'
  ]
}

https://cli.vuejs.org/config/#transpiledependencies

By default babel-loader ignores all files inside node_modules . If you want to explicitly transpile a dependency with Babel, you can list it in this option.

Thank you but i tried that and wont work, i still get the blank page with IE

You need to restart the project.

1 Like

Worked!!! I had to restart IE also :slight_smile: Thanks

1 Like

For me it didnt help. Could you please show your package.json