Invalid call to runtime.sendMessage(). Tab not found. is a Chrome extension error that appears when an extension’s content script tries to communicate with a tab that has been closed or doesn’t exist. This error comes from browser extensions installed by your users, not your code, but it shows up in your error logs.

The error is particularly common with password managers (LastPass, Bitwarden, 1Password), ad blockers, and other extensions that inject content scripts into every page. When tabs close or navigation happens quickly, these extensions can lose track of their target tabs and throw this error.

The Problem

Browser extensions inject content scripts into web pages to add functionality. These scripts communicate with their background processes using Chrome’s messaging APIs:

// Extension content script trying to message its background
chrome.runtime.sendMessage({action: 'checkPassword'}, response => {
  // Error: Tab not found if the tab closed
});

When the target tab is closed, navigated away, or doesn’t exist, Chrome throws this error. Your website’s error monitoring captures it because the extension’s content script runs in your page’s context.

Understanding the Root Cause

This error originates from browser extensions, not your application code. Extensions use Chrome’s messaging API to communicate between different parts of the extension.

How Extension Messaging Works

Browser extensions have multiple components:

  • Content Scripts: Run in the context of web pages
  • Background Scripts: Run in the extension’s background
  • Popup Scripts: Run in the extension’s popup UI

These components communicate via Chrome’s messaging API. When a tab closes mid-communication, the error occurs.

Common Culprit Extensions

Password Managers

  • LastPass
  • 1Password
  • Bitwarden
  • Dashlane

These extensions inject scripts to detect login forms and auto-fill credentials. They frequently message background scripts to check for saved passwords.

Ad Blockers

  • AdBlock
  • uBlock Origin
  • AdGuard

Ad blockers inject scripts to scan and modify page content, constantly communicating with their background processes about blocked elements.

Developer Tools

  • React DevTools
  • Vue DevTools
  • Redux DevTools

Developer extensions inject scripts to inspect your application state and communicate findings back to their panels.

Other Common Extensions

  • Grammarly (checks text fields)
  • Honey (looks for coupons)
  • Loom (screen recording)
  • Google Translate

Why Tabs Disappear

  • User closes tab: Most common cause - user closes tab while extension is mid-operation
  • Fast navigation: User navigates away before extension finishes its work
  • Page refresh: Page reloads interrupt extension communication
  • Browser crashes: Tab process dies unexpectedly
  • Memory pressure: Browser kills tabs to free memory on low-end devices

How to Fix Invalid call to runtime.sendMessage()

Since this error comes from browser extensions, not your code, you can’t truly “fix” it. However, you can handle it appropriately.

Troubleshooting Checklist

  • Confirm error is from an extension (check stack trace for chrome-extension://)
  • Identify which extension (URL often contains extension ID)
  • Verify it’s not breaking your app functionality
  • Decide whether to filter these errors from your monitoring
  • Consider if your app’s behavior triggers the issue

Step 1: Identify the Extension Source

Check the error’s stack trace for extension URLs:

// Stack trace will show something like:
Error: Invalid call to runtime.sendMessage(). Tab not found.
  at chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/contentscript.js:42:8
  at chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/messaging.js:15:3

The extension ID (hdokiejnpimakedhajhdlcegeplioahd in this example) can help identify which extension is causing issues. You can look up common extension IDs or search for them in the Chrome Web Store.

Step 2: Ignore Extension Errors

If these errors don’t affect your users, ignore them from your error monitoring. TrackJS has a quick action to ignore all browser extension errors, or you can create an ignore rule for this specific message.

Step 3: More Selective Filtering

Track chrome-extension:// error volumes to understand their impact on your monitoring clarity. TrackJS web monitoring automatically captures these extension errors with built-in filtering capabilities, helping you gauge how much noise extension interactions generate compared to actual application issues.

While these errors should be filtered from alerts, monitoring their patterns can reveal insights about your user base’s extension usage and potential compatibility considerations.

When to Ignore This Error

You should typically ignore this error when:

  • It’s from third-party extensions: You can’t control user extensions
  • No user impact: The error doesn’t break your app functionality
  • High volume, low value: Flooding your logs without actionable info
  • Known extensions: Common extensions like LastPass that users expect

However, DON’T ignore it when:

  • Your browser extension: If you develop an extension causing this
  • Correlation with bugs: If this error correlates with user-reported issues
  • Specific problematic extensions: If one extension consistently breaks your app
  • Security concerns: If the extension errors reveal security issues

Example ignore rule for error monitoring:

// Error monitoring service ignore rules
const ignoreRules = [
  {
    // Ignore all extension tab not found errors
    message: /Invalid call to runtime\.sendMessage.*Tab not found/,
    source: /chrome-extension:\/\//
  },
  {
    // Ignore specific known problematic extensions
    source: /chrome-extension:\/\/(hdokiejnpimakedhajhdlcegeplioahd|nngceckbapebfimnlniiiahkandclblb)/
  }
];

Summary

Invalid call to runtime.sendMessage(). Tab not found. is a browser extension error that appears in your logs but isn’t your fault. It happens when extensions try to message tabs that have closed or navigated away. To handle it:

  1. Identify it’s from an extension via the stack trace
  2. Filter these errors from your monitoring if they’re noise
  3. Monitor patterns to catch problematic extensions
  4. Use defensive coding if your app triggers rapid navigation
  5. Ignore the error unless it correlates with real user issues

You can’t prevent users from installing extensions, but you can keep these errors from cluttering your logs and focus on real issues in your application code.


Keep your error monitoring focused on real issues with TrackJS Error Monitoring. Automatically filter out noisy extension errors and focus on the bugs that actually affect your users.

TrackJS is the easy way to monitor your JavaScript applications and fix production errors. TrackJS is provides detailed error monitoring and alerting to developers around the world at companies like 3M, Tidal, IKEA, Venmo, Allbirds, and Frontend Masters. TrackJS catches millions of errors from users everyday. Let's start catching yours.

Protect your JavaScript