Javascript Promise 错误消息端口在收到响应之前关闭

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43154963/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 01:42:38  来源:igfitidea点击:

Promise error The message port closed before a reponse was received

javascriptpromise

提问by Bomber

I've just started to get this error:

我刚刚开始收到此错误:

Uncaught (in promise) Objectmessage: "The message port closed before a reponse was received."

Uncaught (in promise) Objectmessage: "The message port closed before a reponse was received."

at chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/browser-polyfill.js at this line:

在 chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/browser-polyfill.js 在这一行:

const makeCallback = promise => {
  return (...callbackArgs) => {
    if (chrome.runtime.lastError) {
      promise.reject(chrome.runtime.lastError); // uncaught in promise
    } else if (callbackArgs.length === 1) {
      promise.resolve(callbackArgs[0]);
    } else {
      promise.resolve(callbackArgs);
    }
  };
};

Do you know what can cause it?

你知道是什么原因造成的吗?

Thanks

谢谢

采纳答案by PaladiN

Update:

更新:

As of the comment by morficus, the problem has been fixed in the version: 4.0.1

截至morficus的评论,该问题已在版本中修复:4.0.1

The plugin will auto-update or you could reinstall from here:

该插件将自动更新,或者您可以从这里重新安装:

https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg

https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg

If anyone is interested in the issue the pull request is here:

如果有人对这个问题感兴趣,拉取请求在这里:

https://github.com/AliasIO/Wappalyzer/pull/1491

https://github.com/AliasIO/Wappalyzer/pull/1491

2019 Edit:

2019年编辑:

If that is not solving your issue. You could try disabling all the chrome extensions and check if that solve your issue.

如果这不能解决您的问题。您可以尝试禁用所有 chrome 扩展并检查是否可以解决您的问题。

To disable you could type the below code in chrome url:

要禁用,您可以在 chrome url 中键入以下代码:

chrome://extensions/

铬://扩展/

or could go on

或者可以继续

Settings > Extensions

设置 > 扩展

After that you could enable each extensions and check the culprit.

之后,您可以启用每个扩展并检查罪魁祸首。

Older issue:

较旧的问题:

It is not the chrome's bug but the bug with the wappalyzer extension.

这不是 chrome 的错误,而是 wappalyzer 扩展的错误。

I am not sure you are using it but i have used it and was just updated and got the same issue.

我不确定您是否在使用它,但我已经使用过它并且刚刚更新并遇到了同样的问题。

Here is the proof of the issue:

以下是问题的证明:

https://github.com/AliasIO/Wappalyzer/issues/1487

https://github.com/AliasIO/Wappalyzer/issues/1487

We need to wait until there is any solution for the extension or use the older version of the extension until it gets resolved.

我们需要等到扩展有任何解决方案或使用旧版本的扩展,直到它得到解决。

回答by jgpATs2w

In my case was due to the extension 'Katalon recorder'. Probably the most generalistic solution is:

在我的情况下是由于扩展名“ Katalon recorder”。可能最通用的解决方案是:

  • Disable all all extensions in chrome://extensions
  • Enable extensions one by one to detect which one is presenting de issue.
  • 禁用 chrome://extensions 中的所有扩展
  • 一一启用扩展以检测哪个扩展存在问题。

回答by Paul Razvan Berg

Using Chrome ^71.0and this issue pops in multiple extensions. I comprised a list that caused trouble for me + all other reporters in this thread:

使用 Chrome 时^71.0,这个问题会出现在多个扩展程序中。我在这个线程中列出了一个给我带来麻烦的列表+所有其他记者:

回答by Bryan Neely

Mine was due to the Google Publisher Toolbar extension. Disabled that and the error went away.

我的原因是 Google 发布商工具栏扩展程序。禁用它,错误就消失了。

回答by arslanaybars

In my case it happens because of Foxit PDF Creator 8.2.0.2for the information.

在我的情况下,这是因为Foxit PDF Creator 8.2.0.2信息。

Foxit PDF Creator

福昕 PDF 生成器

回答by Abdeali Siyawala

If you are using live-server to auto refresh the browser, then this error was coming up. I stopped the live-server and then opened the index.html file on browser this error didn't come up.

如果您使用 live-server 自动刷新浏览器,则会出现此错误。我停止了实时服务器,然后在浏览器上打开了 index.html 文件,这个错误没有出现。

回答by Sneha Singh

this Helps me to overcome with this error by removing the Selenium (Chrome Extension)

这有助于我通过删除 Selenium(Chrome 扩展程序)来克服此错误

Promise error:

承诺错误:

The message port closed before a response was received

because you have installed Selenium (Chrome Extension)

因为您已经安装了 Selenium(Chrome 扩展程序)