VUE3 TypeError: defineConfig is not a function

编程入门 行业动态 更新时间:2024-10-13 20:14:53

VUE3 <a href=https://www.elefans.com/category/jswz/34/1771446.html style=TypeError: defineConfig is not a function"/>

VUE3 TypeError: defineConfig is not a function

VUE3 TypeError: defineConfig is not a function

      • 1. 问题
      • 2. 原因
      • 3. 解决

1. 问题

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

2. 原因

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

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

3. 解决

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

更多推荐

VUE3 TypeError: defineConfig is not a function

本文发布于:2023-11-16 04:02:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1612422.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:TypeError   function   defineConfig

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!