TypeError: defineConfig is not a function

发布时间 2023-11-17 02:38:41作者: 长情不羁的五年

 

原因:由于用vue-cli直接创建了vue 3的项目,而里面的生态并非都是最新版,vue.config.js中的代码如下,使用了vue 3的语法:

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true
})

  

 

 解决:输入 vue upgrade,一路向下,即可解决