vscode-live-server icon indicating copy to clipboard operation
vscode-live-server copied to clipboard

error in chrome dev tools - Unchecked runtime.lastError: The message port closed before a response was received.

Open vk011 opened this issue 6 years ago • 42 comments

An error appears in the console in chrome dev tools upon launching Live Server

Unchecked runtime.lastError: The message port closed before a response was received.
  • browser - Chrome (desktop) version 72
  • Live Server: 1.30.2
  • Platform: Windows
  • Visual Studio Code: latest

vk011 avatar Feb 04 '19 07:02 vk011

What version of the extension are you using?

adesugbaa avatar Feb 05 '19 23:02 adesugbaa

should be the latest one, 5.3.1 I think. This actually only started happening recently.

vk011 avatar Feb 05 '19 23:02 vk011

Please download 5.4.0 from this repo (under Releases), and try installing that manually.

View -> Command Pallete... -> Extensions Install from VSIX...

If there is any error, please paste the errors or screenshot from the Developer Tools.

adesugbaa avatar Feb 05 '19 23:02 adesugbaa

Hello, I removed the live server version I had and I downloaded LiveServer-5.4.0.vsix from releases and installed it, however it looks identical to what I had before (still says latest update was 5.3.1 in the description) and I still get the same error in console. Just to make it clear the extension works, but there's that annoying console error message still:

Unchecked runtime.lastError: The message port closed before a response was received.

vk011 avatar Feb 05 '19 23:02 vk011

Live server just updated to actual v 5.4 this time but the same error still persists in chrome.

vk011 avatar Feb 08 '19 07:02 vk011

Hi vk011 - This might be an issue with an extension you have from chrome. Try disabling them (chrome://extensions) and enabling them one by one to find the culprit. This worked for me.

dchapo avatar Feb 15 '19 02:02 dchapo

@dchapo That was it man, thanks!

vk011 avatar Feb 15 '19 15:02 vk011

@vk011 Hey which extension caused the problem for you?

rohitkrishna094 avatar Feb 17 '19 02:02 rohitkrishna094

@rohitkrishna094 I think it was some kind of a video downloader, not sure which one though.

vk011 avatar Feb 17 '19 06:02 vk011

I had the same problem today and resolved it by disabling the following Chrome Extension;

https://chrome.google.com/webstore/detail/video-downloader-professi/elicpjhcidhpjomhibiffojpinpmmpil?hl=en

ghost avatar Feb 21 '19 09:02 ghost

Hi @everyone. I figured out why it's happening. a small bug is there. You'll get an update with the fixes in this weekend. :)

ritwickdey avatar Feb 21 '19 09:02 ritwickdey

Anything else? I still get such error with chrome 72.0.3626.121

bbb324 avatar Mar 13 '19 08:03 bbb324

For those coming here to debug this error in Chrome 73, one possible reason is that Chrome 73 onwards disallows cross-origin requests in content scripts.

More reading:

  1. https://www.chromium.org/Home/chromium-security/extension-content-script-fetches
  2. https://www.chromestatus.com/feature/5629709824032768

This affects many Chrome extension authors, who now need to scramble to fix the extensions because Chrome thinks "Our data shows that most extensions will not be affected by this change."

UPDATE: After fixing my extension CORS issue, I still see this error. I don't know what is causing it :/

ernsheong avatar Mar 17 '19 13:03 ernsheong

Hi, any updates on this?

ghost avatar Apr 02 '19 20:04 ghost

Wondering if there is any update on this as well

jonathan-c avatar Apr 10 '19 16:04 jonathan-c

Subscribing here.

davision avatar Apr 16 '19 15:04 davision

I have solved this problem, some extention will cause this error, so you can use the no trace mode of chrome to develop, and ctrl + shift + N can come in this mode, then you can see the error is gone.

szfiligon avatar Apr 26 '19 06:04 szfiligon

I have solved this problem, a video down-loader extension will cause this error,

The message port closed before a response was received

https://chrome.google.com/webstore/detail/meddlemonkey/moihledlmchhofenpacbhphnbnpakgmo

BilalRratimi avatar May 11 '19 10:05 BilalRratimi

was the Stylish extension for me causing this problem. I disabled and re-enabled it and now I don't get those logs

charisTheo avatar May 14 '19 10:05 charisTheo

I had same Error with this following chrome Extension https://chrome.google.com/webstore/detail/foxit-pdf-creator/cifnddnffldieaamihfkhkdgnbhfmaci

notAnyMore778899 avatar May 29 '19 04:05 notAnyMore778899

Unchecked runtime.lastError: The message port closed before a response was received.

Seems that some chrome extension that you have installed recently is creating problem. If you remove the recent installed extension then it will solve your problem. See your chrome extension:
chrome://extensions

ping2anilsharma avatar May 30 '19 04:05 ping2anilsharma

Hey i found two solutions to this bug/error:

Incognito browsing is quickest option or:

try disable extensions, and find which one cause that issue, for me was : Google Docs Offline 1.7

JiiXaa avatar Jun 12 '19 08:06 JiiXaa

I have solved this problem, a video down-loader extension will cause this error,

The message port closed before a response was received

https://chrome.google.com/webstore/detail/meddlemonkey/moihledlmchhofenpacbhphnbnpakgmo

solved,,,, thank you

wakudiallah avatar Jun 24 '19 03:06 wakudiallah

I"m under the impression we're mixing two distinct cases in this discussion:

Case #_1. You're a user that have extensions installed, and one or more of them is causing the problem.

  • In this case, identifying and disabling the extension is the best way, as already suggested above.

Case #_2 - You're a developer and your extension is throwing the error.

  • Of course, you don't want to disable your own extension, but solve the problem. Despite the solution given by @ernsheong at https://github.com/ritwickdey/vscode-live-server/issues/270#issuecomment-473667533 (above) didn't work for him, I believe it's the best start point for it. Also, I've been seen some solutions that recommend the developer to add return true to the the callback function (eg. https://github.com/mozilla/webextension-polyfill/issues/130#issuecomment-484772327) to make sure that the function will wait for the response.

My case is the #2 above and I'm still struggling to implement a complete solution. I'll publish the solution here, in case I find one.

ghost avatar Jul 09 '19 10:07 ghost

I also solve this error. This error comes by what font extension see after disabling it. optional follow me @atulcodex

atulcodex avatar Jul 13 '19 06:07 atulcodex

Hi vk011 - This might be an issue with an extension you have from chrome. Try disabling them (chrome://extensions) and enabling them one by one to find the culprit. This worked for me.

Tanks!! extension that was wrong here: https://chrome.google.com/webstore/detail/cuponomia-cupom-e-dinheir/gidejehfgombmkfflghejpncblgfkagj?hl=pt-BR

davifsroberto avatar Jul 16 '19 12:07 davifsroberto

Google Publisher Toolbar gave me this problem

dahodd avatar Jul 26 '19 19:07 dahodd

Norton Safe Web 3.9.0.11 (Chrome Extension) was causing the error for me.

bermudez avatar Aug 07 '19 00:08 bermudez

When I disabled 360 Total Security anti virus chrome extension, the problem was resolved.

emzola avatar Aug 21 '19 04:08 emzola

Go to chrome://extensions/ and determine which extension is causing the error.

Kongoda avatar Sep 01 '19 02:09 Kongoda