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 ...
随机推荐
- 关于如何在IDEA里面配置好Git和Github的相关步骤详解
配置Git 1.File->settings 然后选择其中的Version Control: 接着选择其中的Git选项: 2.将文本框内容定位到本地下载git路径下面 然后点击右边的Test测试 ...
- Java Swing的练习感悟
感悟心得 这还是我第一次使用Java Swing写代码呢,直接就是趣味性拉满! 在相关的界面代码的基础上,在必要的位置嵌入Java代码,就可以很好的实现啦! 简单的嘞! (有兴趣的各位可以选择去浅浅地 ...
- 全网最详细中英文ChatGPT接口文档(三)30分钟快速入门ChatGPT——资源库
目录 Python library(Python库) Node.js library(Node.js库) Community libraries 社区图书馆 C# / .NET Crystal Go ...
- TCP 三次握手,给我长脸了噢
大家好,我是小富~ 个人资源分享网站:FIRE 本文收录在 Springboot-Notebook 面试锦集 前言 之前有个小伙伴在技术交流群里咨询过一个问题,我当时还给提供了点排查思路,是个典型的八 ...
- 被冰封的 Bug:Fishhook Crash 修复纪实
作者:郝连福,业界资深计算机技术专家,现任声网Agora 首席前端架构师.先后担任过 Principal Engineer/Engineering Director(UTStarcom).Sr. ar ...
- ARP协议:网络世界的临门一脚
大家好,我是风筝. 各位同学肯定见过关于网络的面试题,什么TCP协议和UDP的区别啦,IP协议工作在哪层啊等等,这都是网络中定义的各种协议.这些标准化的协议就是网络分层模型标准化的核心部分.要想搞懂网 ...
- 【git】学习笔记
一.git原理 git只能跟踪文本文件的变化,比如txt文件.程序代码等.而对于图片.视频等二进制文件的变化,就无法知道变化了哪里. git 分支的理解:如下图所示,git分支可以理解为是一个指针以及 ...
- H5 visibilityChange事件 --- 监听页面的显示或者隐藏 新开一个webview
mounted() { document.addEventListener('visibilityChange', 事件处理函数) }, destoryed() { document.removeEv ...
- 亚马逊商品页面爬取(使用headers字段).py(亲测有效)
import requests def getHTMLText(url): try: kv = {'user-agent':'Mozilla/5.0'} # 请求头;指定访问浏览器为Mozilla5. ...
- Sevlet规范:HttpServlet类 和 HttpServletRequest接口 源码解析
Sevlet规范:HttpServlet类 和 HttpServletRequest接口 源码解析 每博一文案 命运总是不如人愿,但往往是在无数的痛苦总,在重重的矛盾和艰辛中,才是人成熟起来. 你,为 ...