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

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

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 41 (1 by maintainers)

Most upvoted comments

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.

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

@dchapo That was it man, thanks!

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

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

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.

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.

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 😕

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