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 ...
- 报错TypeError: Cannot set property ‘type‘ of undefined
TypeError: Cannot set property 'type' of undefined报错问题 <script> export default {data () {retur ...
- VUE中axios 报错 TypeError: Cannot set property ‘type‘ of undefined,
报错: 导致axios里then的方法不执行 问题: 后台数据没有传到前端导致传的是一片空 不是null也不是 undefined 是没有东西 导致resp响应为空在底层会报错 以上在catch里做逻 ...
- bug之bootstrap switch Uncaught TypeError: Cannot read property 'apply' of undefined
2019独角兽企业重金招聘Python工程师标准>>> <input type="checkbox" name="my-switch" ...
- datatables插件AJAX请求数据报错Uncaught TypeError: Cannot read property ‘length‘ of undefined
之前常用的表格插件是bootstraptable·,现在换了地方工作,这边用的是datatables.上午再看官网API,感觉写的不是很清晰很到位. 看到一篇博客写的很详细,收藏了.最全的jquery ...
- DateTimePicker 日期时间选择器报错 Cannot read property ‘getHours‘ of undefined, 无法选中`[__ob_: observer__]`时做判断
我在一次开发中遇到了这个情况:使用DateTimePicker 日期时间选择器,出现无法选中, 报错 Cannot read property 'getHours' of undefined, 这个原 ...
- 解决echart中:Cannot read property ‘queryComponents‘ of undefined
在使用案例的echart的日历图表的时候,遇到了: Uncaught TypeError: Cannot read property 'queryComponents' of undefined 思考 ...
- 小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined
小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined Component({/*** 组件的属性列表*/propert ...
- uEditor setContent方法报错Uncaught TypeError: Cannot read property ‘innerHTML‘ of undefined
uEditor setContent方法报错Uncaught TypeError: Cannot read property 'innerHTML' of undefined 报错信息 解决方法 报错 ...
最新文章
- java-Java可以对方法进行序列化?
- 【论文解读】ICLR2020 | 深度自适应Transformer
- boost::fusion::remove_if用法的测试程序
- python六十四课——高阶函数练习题(一)
- Ubuntu下软件的安装、卸载方法
- linux ps pstree pstack命令
- 数学习题:求解不定方程a^2 + b^2 = 3025
- 用HTML5 Canvas为网页添加动态波浪背景
- JavaScript学习(十六)—实现购物车加减数量,计算总金额
- html风格的滚动条
- 2021-06-27 方法的调用
- w讠ndows Boot Manager,Win10电脑无法开机提示Windows boot manager的解决方案
- ospf(MGRE的星型结构和全连结构)
- @RequiresRoles使用
- HTML让背景图片铺满整个图片
- const与指针用法
- 各大搜索引擎登陆入口
- 转:经典Excel VBA代码
- 算法笔记--素数筛(朴素筛,埃式筛,欧拉筛)
- 大数据安全--敏感数据识别和分级打标
热门文章
- Flask实现ElasticSearch搜索
- android模糊检索_Android中实现输入框实时模糊搜索效果的方法
- 三相逆变器 PID 工作原理
- 2021计算机保研夏令营、预推免英语问答
- SQL Server AlwaysON从入门到进阶(2)——存储
- 小波变换图像融合_图像视频降噪的现在与未来——从经典方法到深度学习
- 解决安卓UVCCamera YUY2格式花屏,MTK无法出视频等问题
- 无法连接到 recaptcha_秦皇岛靠谱的m8圆形连接器近期价格-为乐电气
- mydockfinder怎么用?mydockfinder使用教程
- 一步一个脚印重头开始!