今一个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--事务案例的实现

    案例实现(主要是想用Spring实现一下MyBatis的相关内容) JDBCConfig.java MyBatisConfig.java SpringConfig.java accountDao.ja ...

  2. 全网最详细中英文ChatGPT接口文档(二)30分钟开始使用ChatGPT——快速入门

    目录 Quickstart 快速启动 Introduction 导言 1 Start with an instruction 从说明开始 2 Add some examples 添加一些示例 3 Ad ...

  3. 90 条简单实用的 Python 编程技巧,建议收藏

    编码原则 建议 1:理解 Pythonic 概念 -- 详见 Python 中的<Python 之禅> 建议 2:编写 Pythonic 代码 避免不规范代码,比如只用大小写区分变量.使用 ...

  4. Quicker快速开发,简单的网页数据爬取(示例,获取天眼查指定公司基础工商数据)

    前言 有某个线上项目,没有接入工商接口,每次录入公司的时候,都要去天眼查.企查查或者其他公开数据平台,然后手动录入,一两个还好说,数量多了的重复操作就很烦,而且,部分数据是包含超链接,一不注意就点进去 ...

  5. 3.HTTP协议

    HTTP协议 目录 HTTP协议 1.常见HTTP客户端 思考 1.网络协议为什么要分层? 2.www包含了哪些技术? 3.http请求/响应报文包含了哪些内容? 4.http特点有哪些? 2.代理的 ...

  6. Windows Server 远程桌面(RDP)使用公网可信机构所签发的SSL证书的方法

    Windows Server 远程桌面默认使用系统自签名证书,在任何终端进行远程桌面登录时均会提示证书告警 虽然可以通过勾选下方"不再询问我是否连接到此计算机"选项使之后登录不再提 ...

  7. Javascript 加密解密方法

    本文链接 https://www.cnblogs.com/zichliang/p/17265960.html Javascript 和 我之前发的 python加密 以及 go加密 解密不一样 不需要 ...

  8. 解决el-checked-group中v-medel绑定的是一个数组对象方法(不用修改源码)

    思路:弃用el-checked-group使用el-checked模拟 <!DOCTYPE html> <html> <head> <meta charset ...

  9. JS - new Function

    Function 在JavaScript当中,除了可以使用function或箭头函数定义方法外,还可以使用new Function的形式动态创建函数,此时与eval()方法类似 创建一个不接收参数的方 ...

  10. [nefu]C++程序设计与分析实验 - 锐格

    [nefu]C++程序设计与分析实验 - 锐格 第二章 C++基础 5330 #include<iostream> #include<iomanip> using namesp ...