Cannot read property ‘type‘ of undefined Occurred while linting **\index.jsx:1
今一个react 中使用mobx 老是提示Cannot read property 'type' of undefined Occurred while linting **\index.jsx:1

头疼起初是认为是 @observable的问题,于是修改了整个js
将:
export default class AppState {
@observable count = 1
@observable name = 'jack'
@computed get msg() {
return `${this.name} say count is ${this.count}`
}
@action add() {
this.count += 1
}
}
改成了:
const AppState = observable({
// observable 属性:
name: 'John',
count: 42,
showAge: false,
// @computed 计算属性:
get msg() {
return `${this.name} say count is ${this.count}`;
},
// @action 动作:
add() {
this.count += 1;
},
})
然而重新运行只是少了一些错误罢了,问题依然未解决

最后在 “Cannot read property ‘type’ of undefined” after upgrading to 4.14.0 #9767
找到了一个解决方法
将"babel-eslint": "^7.2.3",升级为"babel-eslint": "^8.1.1", 这下终于没提示了
Cannot read property ‘type‘ of undefined Occurred while linting **\index.jsx:1的更多相关文章
- JS报错:Cannot read property 'type' of undefined
在做图片上传功能的时候,遇到了JS无法识别图片type的问题,在使用过程中是没有问题的,但是不知道为什么浏览器的Console报这个错误: Uncaught TypeError: Cannot rea ...
- Cannot read property 'type' of undefined ....
一直解决不了,弄了半天是 jquery 版本太低,换一个版本就ok.
- AngularJs Type error : Cannot read property 'childNodes' of undefined
参考博客: https://blog.csdn.net/u011127019/article/details/73087868 在AngularJs和JQuery插件共存咋项目中经常会遇到如下异常 T ...
- [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...
- Cannot read property 'validate' of undefined
在使用element-UI表单验证中一直报错,'Error in event handler for “click”: “TypeError: Cannot read property ‘valida ...
- angular bootstrap timepicker TypeError: Cannot set property '$render' of undefined
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- vue表单校验提交报错TypeError: Cannot read property 'validate' of undefined
TypeError: Cannot read property 'validate' of undefined at VueComponent.submitForm (plat_users.html: ...
- SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 SignalR 简单示例 通过三个DEMO学会SignalR的三种实现方式 SignalR推送框架两个项目永久连接通讯使用 SignalR 集线器简单实例2 用SignalR创建实时永久长连接异步网络应用程序
SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 异常汇总:http://www ...
- DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined
DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined 原因:table 中定义的列和aoColumns ...
- [Element-UI] 使用Element-UI的DateTimePicker组件报错:Cannot read property 'getHours' of undefined
使用Element-UI组件的DateTimePicker,如下: <template> <div class="block"> <span clas ...
随机推荐
- IDEA-日志管理神器
Grep Console-插件的好处就在于能使控制台输出日志时,可以直接修改插件中定义好的规则,也可以根据自己定义的规则,输出不同的颜色.这样就可以将错误信息标记成显眼的颜色,方便查看,提高bug寻找 ...
- java方法参数(超详细)
前言 在上一篇文章中,壹哥给大家讲解了方法的定义.调用和返回值,但方法的内容还有很多,比如方法的参数是怎么回事?接下来壹哥会在这篇文章中,继续给大家讲解方法参数相关的知识,这就是我们今天要学习的内容. ...
- Redis - 基础数据类型
简介 根据 官网文档 的解释,可以了解 Redis 基础数据类型的一些基本信息: 对于 Redis 来说,存储的 key 值都是字符串类型,讨论数据类型的时候,指的都是存储的 value 值.这里主要 ...
- Java 泛型与通配符 定义与使用
一.泛型 定义: 把类型明确的工作推迟到创建对象或调用方法时才明确的类型,简而言之,未明确的数据类型. 类型: 泛型类,泛型方法,方形接口. 格式 泛型类格式:class 类名<E变量>{ ...
- SpringBoot高频面试题
Springboot的优点 内置servlet容器,不需要在服务器部署 tomcat.只需要将项目打成 jar 包,使用 java -jar xxx.jar一键式启动项目 SpringBoot提供了s ...
- cephadm 安装部署 ceph 集群
介绍 手册: https://access.redhat.com/documentation/zh-cn/red_hat_ceph_storage/5/html/architecture_guide/ ...
- python入门教程之八列表,字典,字符串,集合常用操作
一列表常用方法 Python包含以下函数: 序号 函数 1 cmp(list1, list2)比较两个列表的元素 2 len(list)列表元素个数 3 max(list)返回列表元素最大值 4 mi ...
- [Linux]RabbitMQ - 解决Error: unable to connect to node rabbit@localhost: nodedown
1 问题 环境: CentOS7.8.2003 (x86 / 64bit) 版本: RabbitMQ 3.6.15 (Erlang 19.3) 安装方式: 二进制源码压缩安装 2 解决思路 2.1 思 ...
- 在Blazor中使用Chart.js
1. 在Blazor中使用Chart.js 首先,从Chart.js官方网站下载Chart.js库文件. 推荐下载这个构建好的版本https://cdnjs.com/libraries/Chart.j ...
- 多表查询和python操作mysql
目录 多表查询的两种方法 方法1:连表操作 方法2:子查询 小知识点补充说明 可视化软件NaviCat 多表查询练习题 1.查询所有的课程的名称以及对应的任课老师姓名 2.查询平均成绩大于八十分的同学 ...