Uncaught runtime errors: × ERROR Cannot read properties of undefined (reading ‘ vue2&vue-router兼容性问题

简介: Uncaught runtime errors: × ERROR Cannot read properties of undefined (reading ‘ vue2&vue-router兼容性问题


在创建vue2项目后安装npm install vue-router后运行代码可能会出现这个报错,这是因为vue2最新版本不兼容,解决方案如下:


  • 卸载当前版本的vue-router:npm uninstall vue-router


  • 下载vue2兼容的vue-router版本npm install vue-router@3.5.2


这样问题就能够成功解决啦。

相关文章
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
Cannot read properties of undefined (reading ‘row‘)
Cannot read properties of undefined (reading ‘row‘)
Cannot read properties of undefined (reading ‘post‘)
Cannot read properties of undefined (reading ‘post‘)
|
18天前
|
前端开发 小程序 JavaScript
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
|
2月前
|
资源调度 前端开发
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
192 0
|
11天前
|
JavaScript
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式
|
12天前
|
JavaScript
Cannot read properties of undefined (reading ‘$router‘)
Cannot read properties of undefined (reading ‘$router‘)
Cannot read properties of undefined (reading ‘username‘),粗心惹的祸,数据都不知道写呢了,
Cannot read properties of undefined (reading ‘username‘),粗心惹的祸,数据都不知道写呢了,
|
12天前
|
JavaScript 前端开发
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
81 0
Cannot read properties of undefined (reading ‘use‘)-------编程版本问题
Cannot read properties of undefined (reading ‘use‘)-------编程版本问题