An error Unchecked runtime.lastError: The message port closed before a response was received occurs from Chrome browser extensions when a background process or script in a browser extension did not respond in time or was terminated before it could complete its task.
The issue occurred when I was using Vue.js and Laravel for my project.
How to fix the Unchecked runtime.lastError?
Here are some fixes you can follow to troubleshoot and potentially fix this issue:
Fix 1: Identify the Culprit
- Disable all your Chrome extensions.
- Enable them individually, and after enabling each one, check if the error appears.
- Once you identify which extension is causing the problem, you can either update it, reinstall it, or remove it.
- If you go to chrome://extensions/, you can just toggle each extension one at a time and see which one is triggering the issue.
Fix 2: Update Chrome
Ensure that you are using the latest version of Google Chrome. Outdated versions might have bugs or compatibility issues with some extensions.
Fix 3: Extension Permissions
Check if the extension that’s causing the problem has the required permissions. Sometimes, an extension lacking specific permissions might not function correctly.
Fix 4: Update Extension
If an extension is causing the issue, check if an update is available. The developer might have fixed the issue in a newer release.
Fix 5: Clear Cache and Cookies
A corrupted cache or cookies might cause issues. Clearing them might resolve the problem.
Fix 6: Check the Console
Open the Chrome Developer Tools (F12 or Ctrl+Shift+I) and go to the ‘Console’ tab. There might be more detailed error messages there that can give you more insights into the problem.
I hope the solutions mentioned above will help you and fix the error you are having in your system.

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.