24

I am getting the following error in Chrome on Mac (Version 71.0.3578.98) while accessing my angular app:

targets/showTargetsByStream:1 Unchecked runtime.lastError: The message port closed before a response was received.

My app is accessing REST api hosted by a node express server.

Above error is coming for every page, like navigating to new URL within the app.

Also noticed that Safari is not throwing above error.

Appreciate any help in resolving this error.

user2960993
  • 701
  • 2
  • 7
  • 11
  • Just updated Chrome to 71.0.3578.98 and MacOS to 10.13.6 and got the same error on my Angular project. – iamdimitar Dec 26 '18 at 01:24
  • Updated to Chrome to 71.0.3578.98 on macOS 10.13.6 as well and am now seeing this in our React project. From what I can tell this is the socket to Firebase. We are running Firebase 5.7.2. Can't tell if this is a firebase issue or a Chrome issue. – Victoria French Jan 05 '19 at 04:40
  • I am not using Firebase, and this error is still coming. – user2960993 Jan 06 '19 at 06:22
  • Voting to close, as the accepted solution is a configuration issue, and does not relate to fixing/understanding the cause of the programming issue. – Greg Domjan Mar 07 '19 at 03:28
  • Does this answer your question? [How to fix 'Unchecked runtime.lastError: The message port closed before a response was received' chrome issue?](https://stackoverflow.com/questions/54126343/how-to-fix-unchecked-runtime-lasterror-the-message-port-closed-before-a-respon) – miken32 Nov 09 '21 at 18:39
  • the most frustrating problems are caused by things not directly related to the things we've coded last but to a browser/extension/operating system e.t.c. auto upgrade, or a power outage hundreds of km away, so it's a great relief to find examples of the cause and isolate the problem, even to realize we were not that responsible for everything. – alex Jun 02 '22 at 13:04

7 Answers7

56

I've experienced the same problem and noticed that it depends on running extensions.

Try disabling them (or you can use incognito mode if your settings do not allow extensions) to check if this is the cause. If so, you can enable them one by one and identify the guilty one.

In my case it was the Pinterest extension that causes the issue.

Dolfiz
  • 982
  • 3
  • 13
  • 19
13

Click on the gear icon in the console window and put a tick in the "Selected context only" box.

Selected context only ignores all of the nested browser extension contexts.

Mick McG
  • 131
  • 1
  • 2
  • Thank you @Mick McG. Indeed, the checkbox got unchecked after Chrome's last update. – Nico Nov 12 '20 at 12:56
2

for me, It was the "Stayfocusd" extension that causes the problem. By removing it, solves my problem.

Nasir Siraj
  • 191
  • 1
  • 7
0

this error occurs because of extension that we are using on browser. Disable them and try.

0

I've had the same issues as to where i'm running my react app and it would run this error several times in the Console log.

What I've done to try and fix this issue is that I disabled a few of my extensions (Piggy - Automatic Coupons & Cash Back "Extension" to be more specific) then I refreshed the page and now I don't get this stressful error:

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

Other extensions may cause this issue for you but the Piggy - Automatic Coupons & Cash Back extension is the main extension that was causing this issue.

Good luck!

0

for me, "BuiltWith Technology Profiler" extension cause this error and when uninstall it, error not occur again

Hamid Taebi
  • 185
  • 9
0

It was the HonorLock extension causing this for me.

Dan Crosby
  • 11
  • 3