VUE3 TypeError: defineConfig is not a function.docx - Word

1. 问题

在运行npm run serve时,出现报错:

'''plaintext defineConfig is not a function '''

2. 原因

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

'''js module.exports = defineConfig({ transpileDependencies: true }) '''

3. 解决

输入命令 vue upgrade,一直yes,即可解决

第1页,共1页
本文共0个字符
中文(中国)
辅助功能
文档日期2024-04-03 20:33:55