我正在开发一个React应用程序,我使用了一些npm模块,其中一个是我自己构建的。(我的NPM包:https://www.npmjs.com/package/modale-react-rm)。
它是一个用useState()
打开和关闭的简单模式。
导入包后,我的控制台中有一个错误,在几秒钟后突然出现,没有执行任何操作。
Uncaught (in promise) localhost/:1
>{message: 'A listener indicated an asynchronous response by r…age channel closed before a response was received'}
message: "A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received"
>[[Prototype]]: Object
>constructor: ƒ ()
>[[Prototype]]: Object
/* sometimes there are specific elements in addition but I could not check when they appear and when not */
Promise.then (asynchrone)
(anonyme) @content_script_bundle.js:108
handleNewFeatures @content_script_bundle.js:101
handleUpdatedNodes @content_script_bundle.js:101
(anonyme) @content_script_bundle.js:101
childlist(asynchrone)
0 @purplebox.js:1
(anonyme) @purplebox.js:1
v @purplebox.js:1
它不会阻塞我的页面,也不会妨碍其功能的正常运行,但这是一个错误,我认为应该修复它,也许可以帮助其他有同样问题的人。
我指定在这个项目中我不提出任何异步请求。一切都是本地的,我使用的少数数据都是直接导入raw中的。我也不知道Purplebox.js是从哪里来的。
发布于 2022-06-05 11:28:34
发布于 2022-06-29 06:40:12
发布于 2022-07-26 11:11:43
它是图书馆,它被许多扩展(包括Ghostery)使用。有一个铬的最新变化引入了错误消息。
对于正在使用多边形填充的项目,如果合并了一个修复程序,我希望警告会消失。请注意,使用的是多填充库,因为只有火狐实现了新承诺的基于runtime.onMessage的原始回调风格API,而Chrome仍然强制使用原始回调风格API。
请注意,WebExtension-poly填充库中已经有一个开拉请求。它还没有被合并,但是根据我的测试,它解决了这个问题。因此,如果需要对内部使用库的项目进行快速修复,可以使用贴片包装手动应用修补程序。例如,这就是Ghostery中这种变化的样子。。
https://stackoverflow.com/questions/72494154
复制相似问题