[Vuejs]-Npm run serve on vue cli app generated this error, "ERROR Error: .presets[0] must be a string, object, function"

0👍

Your babel.config.js file looks ill-formatted, it should be probably

module.exports = {
  presets: [
    "@vue/cli-plugin-babel/preset", [
      "@vue/app",
      {
        modules: "commonjs"
      }
    ]
  ]
};

Note the comma after "@vue/cli-plugin-babel/preset" and the lack of parentheses ( and ).

Leave a comment