Extension context invalidated Browser Origin: On your device Last updated 15 Oct 2026

Console: Uncaught Error: Extension context invalidated (extension was updated or reloaded)

A content script from an extension kept running after the extension was reloaded, updated or removed, so its link to the extension is broken.

Exact message you may see Extension context invalidatedUncaught Error: Extension context invalidatedError: Extension context invalidated.Could not establish connection. Receiving end does not exist
Seen on: Chrome Edge JavaScript

Meaning

Open tabs keep the old content script alive. When the extension updates, calls such as chrome.runtime.sendMessage throw this error until the page is reloaded. Users fix it with a refresh; extension authors should catch it and stop their script cleanly.

Common causes

  • Extension updated or reloaded while the page stayed open (very common in development)
  • Extension disabled or uninstalled
  • Service worker (Manifest V3) restarted and state lost
  • Long-lived port closed
  • Orphaned content script calling chrome.* APIs

⚡ Quick fix

  1. Reload the page (and the extension during development)
  2. Extension authors: wrap chrome.runtime calls in try/catch and detect chrome.runtime?.id
  3. Re-inject the content script after an update

Detailed fix by platform

JavaScript

  1. if (!chrome.runtime?.id) { cleanup(); return; } before calling extension APIs; wrap sendMessage in try { ... } catch (e) { if (/Extension context invalidated/.test(e.message)) cleanup(); }

Chrome

  1. chrome://extensions → reload the extension, then reload the open tabs

How to diagnose

  1. Timing — Did the extension update or reload?
  2. Tab — Is the page older than the extension?
  3. Code — Own extension?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Aw, Snap! — Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory (Browser)Aw, Snap!captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalDevTools failed to load source map — DevTools: Failed to load source map — Could not load content for https://…/app.js.map: HTTP error: status code 404 (Browser)DevTools failed to lo…ERR_BLOCKED_BY_CLIENT — net::ERR_BLOCKED_BY_CLIENT (JavaScript)ERR_BLOCKED_BY_CLIENTThe canvas has been tainted by cross-origin data — Console: SecurityError: Failed to execute 'toDataURL' / 'getImageData' on 'HTMLCanvasElement': Tainted canvases may not be exported (Browser)The canvas has been t…Uncaught (in promise) — Console: Uncaught (in promise) Error / TypeError / DOMException — unhandled promise rejection (Browser)Uncaught (in promise)Unchecked runtime.lastError — Console: Unchecked runtime.lastError: The message port closed before a response was received (extension message) (Browser)Unchecked runtime.las…Extension…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.