{
  "id": 18633986,
  "title": "Two MV3 errors you hit right after bumping manifest_version (and the fix)",
  "url": "https://urgent.news/2026/11/07/two-mv3-errors-you-hit-right-after-bumping-manifest-version-and-the",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-07T04:05:43.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/lanternflows/two-mv3-errors-you-hit-right-after-bumping-manifestversion-and-the-fix-2p5e"
  },
  "original_language": "en",
  "account": "Switching the manifest_version from 2 to 3 can cause two common errors when migrating a Chrome extension. One error is the service worker registration failing, and the second is the chrome.browserAction being undefined.\n\nIn the background page, which used to be a service worker in MV2, it now needs to be declared as a service worker in MV3. The background property should only contain the service_worker field pointing to the background.js file.\n\nThe browser_action object has been renamed to action, and the chrome.browserAction object has become chrome.action. This renaming affects the code where these objects were used.\n\nIn the case of state management, it's important not to keep state in a global variable. In MV2, the count variable was stored in memory and lost when the service worker stopped. Instead, the refresh function now awaits chrome.tabs.query({}) to get the tab count and sets the badge text accordingly using await chrome.action.setBadgeText({text: String(tabs.length)}).\n\nSeveral other changes are required for a successful migration, including updating the background scripts, toolbar API, state management, callbacks, and startup listeners. It is recommended to thoroughly review the official Chrome MV3 migration guide before proceeding with the migration.",
  "summary": "You change \"manifest_version\": 2 to 3 and the extension breaks. Two errors show up a lot: Service worker registration failed chrome.browserAction is undefined Below is a small made-up teaching example (a tab counter), not a real project or client case. It is a partial migration, checked by reading the files only; it was not run in a browser . 1. The background page has to become a service worker…",
  "key_points": [
    "Switching manifestversion from 2 to 3 causes two common errors",
    "Service worker registration fails in background page of MV3",
    "chrome.browserAction renamed to chrome.action in MV3"
  ],
  "editors_take": "Transitioning to manifest version 3 forces developers to abandon persistent global variables and legacy API objects in favor of service worker architectures and asynchronous state management.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}