TypeError: defineConfig is not a function

 

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

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

  

 

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

posted @ 2023-11-17 02:31  长情不羁的五年  阅读(2070)  评论(0编辑  收藏  举报