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 ...
随机推荐
- AI 影评家:用 Hugging Face 模型打造一个电影评分机器人
本文为社区成员 Jun Chen 为 百姓 AI 和 Hugging Face 联合举办的黑客松所撰写的教程文档,欢迎你阅读今天的第二条推送了解和参加本次黑客松活动.文内含有较多链接,我们不再一一贴出 ...
- 当我把ChatGPT拉进群聊里,我的朋友都玩疯了
前言 近期ChatGPT可以说是太火了,问答.写论文.写诗.写代码,只要输入精确的prompt,他的表现总是让人惊喜.本着打不过就加入的原则.要是把ChatGPT拉入群聊中,会是怎样一番场景?说做就做 ...
- 一文学会Flex布局
参考: <CSS权威指南>(第四版) flex布局教程-语法篇-阮一峰 1.Flex布局是什么 FlexBox,弹性盒布局,顾名思义,就是元素具有弹性,能根据可用空间大小增减尺寸. 2.基 ...
- GO实现Redis:GO实现内存数据库(3)
实现Redis的database层(核心层:处理命令并返回) https://github.com/csgopher/go-redis datastruct/dict/dict.go type Con ...
- LabVIEW之同步——集合点vi
这是一个对我来讲比较偏的工具,做过很多项目,没有用它也能完成各种各样的项目. 今天我们一起来了解下这个工具,所以称之为工具,因为它属于NI LabVIEW的白色节点,一般是有官方利用LabVIEW代码 ...
- vue之字符串的方法
目录 简介 indexOf方法 简介 本文会把遇到的字符串的方法慢慢补充进来 indexOf方法 indexOf方法判断字符串是否包含另一个字符串 判断结果如果包含返回的是索引,如果不包含,则返回-1 ...
- [大数据]Hadoop简述
1 Hadoop:发展沿革 摘要:1个人(Doug Cutting).2个公司(Google.Cloudera) 1.1 渊源 Hadoop项目 最初开发者/创始者: Doug Cutting(道格· ...
- LeeCode 二叉树问题(一)
二叉树的遍历 二叉树节点定义 public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() {} TreeNod ...
- Looper 源码分析
//可以看到我们的Looper是存放在线程独有的ThreadLocal进行隔离的 //也就是每个线程独有一份Looper static final ThreadLocal<Loope ...
- visio秘钥
一.Visio2016专业版永久激活码: Visio 2016 Professional Retail零售版 [Key]:NKVJM-8MTT4-8YDFR-6738M-DPFJH [Key]:W9W ...