今一个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的更多相关文章

  1. JS报错:Cannot read property 'type' of undefined

    在做图片上传功能的时候,遇到了JS无法识别图片type的问题,在使用过程中是没有问题的,但是不知道为什么浏览器的Console报这个错误: Uncaught TypeError: Cannot rea ...

  2. Cannot read property 'type' of undefined ....

    一直解决不了,弄了半天是 jquery 版本太低,换一个版本就ok.

  3. AngularJs Type error : Cannot read property 'childNodes' of undefined

    参考博客: https://blog.csdn.net/u011127019/article/details/73087868 在AngularJs和JQuery插件共存咋项目中经常会遇到如下异常 T ...

  4. [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...

  5. Cannot read property 'validate' of undefined

    在使用element-UI表单验证中一直报错,'Error in event handler for “click”: “TypeError: Cannot read property ‘valida ...

  6. angular bootstrap timepicker TypeError: Cannot set property '$render' of undefined

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. vue表单校验提交报错TypeError: Cannot read property 'validate' of undefined

    TypeError: Cannot read property 'validate' of undefined at VueComponent.submitForm (plat_users.html: ...

  8. 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 ...

  9. DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined

    DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined 原因:table 中定义的列和aoColumns ...

  10. [Element-UI] 使用Element-UI的DateTimePicker组件报错:Cannot read property 'getHours' of undefined

    使用Element-UI组件的DateTimePicker,如下: <template> <div class="block"> <span clas ...

随机推荐

  1. 阿里云镜像创建Spring Boot工厂

    参考博客:https://blog.csdn.net/qq_40052237/article/details/115794368 http://start.aliyun.com

  2. mongo操作数据库

    1.回顾 2.node + mongodb 2.1 安装mongodb 项目中既可以使用mongodb,但是推荐使用mongoose cnpm i mongoose@4 -S 2.2 连接数据库 一定 ...

  3. day02-搭建微服务基础环境01

    搭建微服务基础环境01 1.创建父工程,用于聚合其他微服务模块 1.1创建父项目 说明:我们先创建一个父项目,该父项目会去管理多个微服务模块(module),如下: (1)File-New-Proje ...

  4. Sevlet规范:HttpServlet类 和 HttpServletRequest接口 源码解析

    Sevlet规范:HttpServlet类 和 HttpServletRequest接口 源码解析 每博一文案 命运总是不如人愿,但往往是在无数的痛苦总,在重重的矛盾和艰辛中,才是人成熟起来. 你,为 ...

  5. [Java/Arthas]Arthas The telnet port 3658 is used by process 13988 instead of target process 11208, y[转载]

    1 问题描述 Arthas 跟踪 一个已经在tomcat部署的工程quality,第一次使用过的是135091号进程,后来出现问题,换进程连接,报错如上图所示,提示端口占用.原因是上次连接了一个进程, ...

  6. [Windows/Linux]判别服务器: 虚拟机 | 物理机 ?

    物理主机,一般称: [宿主机] 虚拟机信息,一般涉及如下关键词: VMware : VMware 虚拟化技术 Vistualbox KVM(Kernel-based Virtual Machine): ...

  7. Centos 7安装Elasticsearch 7.6

    Centos 7安装Elasticsearch 7.6 Elasticsearch与JDK版本对应关系 在安装 Elasticsearch 时,要注意 Elasticsearch 与 JDK 的版本对 ...

  8. oracle数据对比--用户,索引,分区,dblink,同义词,视图

    问题描述:需要对比用户数据一般在数据库迁移之后,需要对比一下两个库之间的差距,如果登上去一条命令的执行,去统计,就会比较麻烦,这里整理了一些脚本可用.通过创建dblink的方式快速查询,也可以整合到一 ...

  9. Dapr和Rainbond集成,实现云原生BaaS和模块化微服务开发

    背景 Dapr 是一个开源的分布式应用运行时,帮助开发者构建松耦合的分布式应用程序,具有良好的可扩展性和可维护性.Rainbond 是一款企业级的云原生应用管理平台,提供了丰富的功能和工具,方便开发者 ...

  10. 从零开始配置深度学习环境:CUDA+Anaconda+Pytorch+TensorFlow

    本文适用于电脑有GPU(显卡)的同学,没有的话直接安装cpu版是简单的.CUDA是系统调用GPU所必须的,所以教程从安装CUDA开始. CUDA安装 CUDA是加速深度学习计算的工具,诞生于NVIDI ...