Add "proposal-object-rest-spread" plugin to babel.config.js to fix Microsoft Edge error SCRIPT1028 Add "proposal-object-rest-spread" plugin to babel.config.js to fix Microsoft Edge error SCRIPT1028 vue.js vue.js

Add "proposal-object-rest-spread" plugin to babel.config.js to fix Microsoft Edge error SCRIPT1028


since I cannot try out the code that you are dealing with to check, I would suggest to use the following babel config as mentioned in the library config:

  plugins: [["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }]]


babel.config.js should export a function and should be at the root of your project.

Your configuration should be similar to this 👇

module.exports = function(api) {    api.cache(true);    const presets = ['@vue/app'];    const plugins = ['@babel/plugin-proposal-object-rest-spread'];    // Or try this    // const plugins = [['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }]];    return {        presets,        plugins,    };};