Chrome控制台报错Cannot read properties of null (reading '__jstcache')求助
问题:Chrome控制台报错
Cannot read properties of null (reading '__jstcache') 问题描述
使用CRA(Create React App)或Vite创建React项目后,Chrome未打开开发者控制台时,或是在Firefox中,应用刷新正常。但在Chrome中打开开发者控制台后刷新页面(或修改代码触发热模块加载),会出现上述报错,页面显示默认离线页面,但电脑实际处于联网状态。关闭控制台或切换标签页后,应用可正常刷新。
已尝试方案
目前未找到有效解决方案。谷歌搜索无相关有效信息,已排除代码问题(空白CRA/Vite项目、谷歌官网均存在该问题)。已尝试以下操作:
- 清除浏览器缓存
- 重置Chrome设置
- 禁用所有浏览器扩展
- 重启电脑
- 清除jest缓存(无效)
暂未尝试卸载Chrome。
环境信息
- 设备:MacBook Pro
- 系统:MacOS Sonoma 14.2.1
- Chrome版本:120.0.6099.216(官方版本)(x86_64)
错误详情
控制台报错及调用栈信息如下:
VM7:3 Uncaught TypeError: Cannot read properties of null (reading '__jstcache') at L (VM7:3:272) at window.jstProcess (VM7:10:576) at VM8:1:488
对应代码片段:
(VM7:3:272) function L(a) { a.__jstcache || n(a, function(b) { M(b) })
(VM7:10:576) window.jstProcess = function(a, b) { var c = new F; L(b); c.m = b ? 9 == b.nodeType ? b : b.ownerDocument || document : document; var e = m(c, c.g, a, b) , d = c.j = [] , g = c.o = []; c.c = []; e(); for (var h, f, k; d.length; ) h = d[d.length - 1], e = g[g.length - 1], e >= h.length ? (e = c, f = d.pop(), f.length = 0, e.c.push(f), g.pop()) : (f = h[e++], k = h[e++], h = h[e++], g[g.length - 1] = e, f.call(c, k, h)) }
(VM8:1:488) const pageData = { "app_short_name": "Create React App Sample", "fontfamily": "system-ui, sans-serif", "fontfamilyMd": "system-ui, sans-serif", "fontsize": "75%", "icon_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR42mMAAQAABQABoIJXOQAAAABJRU5ErkJggg==", "language": "en", "override_error_page": true, "supplementary_icon": "offlineIcon", "textdirection": "ltr", "title": "localhost", "web_app_error_page_message": "You're offline" }; var tp = document.getElementById('t'); jstProcess(new JsEvalContext(pageData), tp);
内容的提问来源于stack exchange,提问作者Calla
相关产品推荐
相关产品推荐

