今一个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. 报错TypeError: Cannot set property ‘type‘ of undefined

    TypeError: Cannot set property 'type' of undefined报错问题 <script> export default {data () {retur ...

  3. VUE中axios 报错 TypeError: Cannot set property ‘type‘ of undefined,

    报错: 导致axios里then的方法不执行 问题: 后台数据没有传到前端导致传的是一片空 不是null也不是 undefined 是没有东西 导致resp响应为空在底层会报错 以上在catch里做逻 ...

  4. bug之bootstrap switch Uncaught TypeError: Cannot read property 'apply' of undefined

    2019独角兽企业重金招聘Python工程师标准>>> <input type="checkbox" name="my-switch" ...

  5. datatables插件AJAX请求数据报错Uncaught TypeError: Cannot read property ‘length‘ of undefined

    之前常用的表格插件是bootstraptable·,现在换了地方工作,这边用的是datatables.上午再看官网API,感觉写的不是很清晰很到位. 看到一篇博客写的很详细,收藏了.最全的jquery ...

  6. DateTimePicker 日期时间选择器报错 Cannot read property ‘getHours‘ of undefined, 无法选中`[__ob_: observer__]`时做判断

    我在一次开发中遇到了这个情况:使用DateTimePicker 日期时间选择器,出现无法选中, 报错 Cannot read property 'getHours' of undefined, 这个原 ...

  7. 解决echart中:Cannot read property ‘queryComponents‘ of undefined

    在使用案例的echart的日历图表的时候,遇到了: Uncaught TypeError: Cannot read property 'queryComponents' of undefined 思考 ...

  8. 小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined

    小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined Component({/*** 组件的属性列表*/propert ...

  9. uEditor setContent方法报错Uncaught TypeError: Cannot read property ‘innerHTML‘ of undefined

    uEditor setContent方法报错Uncaught TypeError: Cannot read property 'innerHTML' of undefined 报错信息 解决方法 报错 ...

最新文章

  1. java-Java可以对方法进行序列化?
  2. 【论文解读】ICLR2020 | 深度自适应Transformer
  3. boost::fusion::remove_if用法的测试程序
  4. python六十四课——高阶函数练习题(一)
  5. Ubuntu下软件的安装、卸载方法
  6. linux ps pstree pstack命令
  7. 数学习题:求解不定方程a^2 + b^2 = 3025
  8. 用HTML5 Canvas为网页添加动态波浪背景
  9. JavaScript学习(十六)—实现购物车加减数量,计算总金额
  10. html风格的滚动条
  11. 2021-06-27 方法的调用
  12. w讠ndows Boot Manager,Win10电脑无法开机提示Windows boot manager的解决方案
  13. ospf(MGRE的星型结构和全连结构)
  14. @RequiresRoles使用
  15. HTML让背景图片铺满整个图片
  16. const与指针用法
  17. 各大搜索引擎登陆入口
  18. 转:经典Excel VBA代码
  19. 算法笔记--素数筛(朴素筛,埃式筛,欧拉筛)
  20. 大数据安全--敏感数据识别和分级打标

热门文章

  1. Flask实现ElasticSearch搜索
  2. android模糊检索_Android中实现输入框实时模糊搜索效果的方法
  3. 三相逆变器 PID 工作原理
  4. 2021计算机保研夏令营、预推免英语问答
  5. SQL Server AlwaysON从入门到进阶(2)——存储
  6. 小波变换图像融合_图像视频降噪的现在与未来——从经典方法到深度学习
  7. 解决安卓UVCCamera YUY2格式花屏,MTK无法出视频等问题
  8. 无法连接到 recaptcha_秦皇岛靠谱的m8圆形连接器近期价格-为乐电气
  9. mydockfinder怎么用?mydockfinder使用教程
  10. 一步一个脚印重头开始!