今一个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. 【转载】vue3 中如何像 vue2 的 extend 一样挂载未挂载的组件,拿到标签本身($el)

    原文地址:https://blog.csdn.net/qq_39953537/article/details/110437554 vue3 中如何像 vue2 的 extend 一样挂载未挂载的组件, ...

  2. 【git】学习笔记

    一.git原理 git只能跟踪文本文件的变化,比如txt文件.程序代码等.而对于图片.视频等二进制文件的变化,就无法知道变化了哪里. git 分支的理解:如下图所示,git分支可以理解为是一个指针以及 ...

  3. Spring MVC 和 Struts 的区别是什么?

    1. 拦截机制的不同 Struts2 是类级别的拦截,每次请求就会创建一个 Action,和 Spring 整合时 Struts2 的 ActionBean 注入作用域是原型模式 prototype, ...

  4. Django笔记五之字段类型

    这篇笔记介绍字段的类型 Field Type. Django 的model 下的 field 对应的是 MySQL 中的表字段,而我们定义的 field 的类型则对应 MySQL 中的字段类型. 本次 ...

  5. (数据科学学习手札151)速通pandas2.0新版本干货内容

    本文示例代码已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 大家好我是费老师,前两天pandas正式发布了其 ...

  6. python入门教程之十五获取对象属性的几种方法

    当我们拿到一个对象的引用时,如何知道这个对象是什么类型.有哪些方法呢? 使用type() 首先,我们来判断对象类型,使用type()函数: 基本类型都可以用type()判断: >>> ...

  7. [网络/Java EE/Web]Tomcat/Nginx中配置全局的安全响应头(header)——X-Frame-Options / X-XSS-Protection / X-Content-Options

    Step1 配置Tomcat step1.1 查看是否已配置目标的HTTP网络安全头 方式1 – Tomcat / conf/web.xml cat /opt/myTomcat/conf/web.xm ...

  8. Hydra详细使用

    1. 简介 Hydra是什么 Hydra是什么: Hydra是一款网络登录破解工具,可以通过暴力破解方式来猜解用户名和密码,从而获取系统的访问权限.它可以支持多种协议,如FTP.SSH.Telnet. ...

  9. 【转载】使用IntelliJ IDEA 14和Maven创建java web项目

    安装Maven 下载安装 去maven官网下载最新版(传送门  密码: gfi1) 解压到安装目录. 配置 右键桌面的计算机图标,属性–>高级系统设置–>环境变量,添加M2_HOME的环境 ...

  10. Java设计模式 —— 工厂模式

    3 简单工厂模式 3.1 创建型模式 Creational Pattern 关注对象的创建过程,对类的实例化过程进行了抽象,将软件模块中对象的创建和对象的使用分离,对用户隐藏了类的实例的创建细节.创建 ...