I have the following error in the Chrome Dev Tools console on every page-load of my Node/Express/React application:
Unchecked runtime.lastError: Could not es
The error is often caused by a chrome extension. Try disabling all your extensions, the problem should disapear.
Cacher Extension in my case - but yeah disable each and then reload page
It was tab bnundler for me: https://chrome.google.com/webstore/detail/tab-bundler/ooajenhhhbdbcolenhmmkgmkcocfdahd
Disabling the extension fixed the issue.
I removed "Video Speed Controller" Chrome Extension and the error was removed. It worked for me like this. In your case there may be some other extensions too which may cause this error.
Removing 'Udacity Frontend Feedback' chrome extension solved the issue for me.
You just need to handle window.chrome.runtime.lastError
in the runtime.sendMessage
callback. It's as simple as that, nothing fancy. I had spent lots of time figuring it out before realizing that this error just needs to be handled. Below is my code:
window.chrome.runtime.sendMessage(
EXTENSION_ID,
{ message:"---" }, // jsonable message
(result) => {
if (!window.chrome.runtime.lastError) {
// do you work, that's it. No more unchecked error
}
}
);
});