[转]Vue使用路由报错Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function

问题描述

原文链接:https://blog.csdn.net/weixin_56541207/article/details/123521263

在运行Vue项目时,使用到了路由,发现页面无效果,按下F12打开浏览器检查模式,发现报错如下:

Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function

产生问题的原因

安装的Vue路由插件版本太高

解决方案

降低版本,使用命令npm install vue-router@3.2.0安装3.2.0版本(亲测有效)
随后重新启动项目即可

posted @ 2022-06-07 23:03  南城小友  阅读(1252)  评论(0编辑  收藏  举报