Chrome throws Unchecked runtime.lastError: The message port closed before a response was received when either there is a conflict with an extension or some of the onMessage
listeners in your created extension is expected to return a promise.
Solution
To solve this issue, first toggle off all the installed extensions in your chrome browser. Then reload the page and check if the issue is resolved. You should not get any error this time. Now turn on the extensions one by one and keep checking the page by reloading after enabling an extension. If you are not getting the error then it means that extension is not causing problem. This way you will get to know the culprit and keep it off.
List of known extensions causing error
Here is the list of those extensions which causes unchecked runtime.lasterror –
- Video Downloader professional
- Flareget Integration
- MeddleMonkey
- Norton Safe Search
- Google Publisher Toolbar
- Norton Safe Web
- Video Speed Controller
- Kaspersky Protection
- Shortkeys (Custom Keyboard Shortcuts)
- What a font
- Color Contrast Analyzer
- Adskill
- Google™ Search Keyboard Shortcuts
- React-Sight
- Stylish
- Screen Capture
- OurStickys – Sticky Notes
- TamperMonkey
- Piggy
- Wappalyzer
- AdGuard
- Augury
- Google Voice
- DuckDuckGo Privacy Essentials
- StayFocusd
- 1password
- OneTab chrome
- Automatic Backlink Checker
- Coupons at Checkout
- Sound Bar
- Auto Tab Discard
- NoCoffee Vision Simulator
- OrangeMonkey
There could be other extensions as well which could create problems. Keep an eye on the installed adblock or antivirus extensions.
For extension developers
If you are an extension developer and getting this error then it means you have issues in your onMessage
calls. Check your extension files like background.js
and look for all onMessage
calls. See if you are returning anything or not.
chrome.runtime.onMessage.addListener(function(rq, sender, sendResponse) { setTimeout(function() { sendResponse({status: true}); }, 1); return true; // Return true to fix the error });