reactjs / reactjs/react.dev

Uncaught TypeError: Cannot read property 'unstable_cancelCallback' of undefined

未关闭
#1,603 0 条评论 18 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
11.8k
派生
7.9k
平均合并
1 天 11 小时
30 天内合并 PR
11

描述

I am having an issue with an exception every time I load a react page and have chrome developer tools open. Would anyone have any suggestions?

I am injecting react and react-dom using webpack, and the versions used are

Uncaught TypeError: Cannot read property 'unstable_cancelCallback' of undefined at react-dom.production.min.js:192 at react-dom.production.min.js:12 at Object.<anonymous> (react-dom.production.min.js:12) at u (bootstrap bb4ee82…:1370) at o (bootstrap bb4ee82…:772) at Object.<anonymous> (vendor.min.js:99413) at u (bootstrap bb4ee82…:1370) at bootstrap bb4ee82…:1422 at bootstrap bb4ee82…:1422

"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-hot-loader": "^4.3.11",

webpack:///./node_modules/react-dom/umd/react-dom.production.min.js

Ec=Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,ag=Ec.unstable_cancelCallback,Nd=Ec.unstable_now,Bh=Ec.unstable_scheduleCallback,Fh=Ec.unstable_shouldYield,Qd=null,Rd=null,Dh="function"===typeof setTimeout?setTimeout:void 0,lg="function"===typeof clearTimeout?clearTimeout:void 0;new Set;var pd=[],Pa=-1,oa={},E={current:oa},O={current:!1},wa=oa,rd=null,sd=null,T=function(a,b,c,d){return new nh(a,b,c,d)}

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 react-dom.production.min.js 的堆栈跟踪以及列出的 React、React DOM 和 react-hot-loader 版本开始,然后检查 webpack 如何注入这些包。在打开 Chrome Developer Tools 的情况下重现该异常,并确定依赖组合是否导致缺少 Scheduler 方法。在该设置下页面加载时不再出现此未捕获的 TypeError,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react, webpack
领域
frontend, web-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。