Add-on Developer Hub yields contradictory results for background key

I am trying to sign a Manifest V3 extension using the web-ext tool. Unfortunately, I am getting contradictory errors related to the background key.

When I use background.scripts I get an error that says I must use background.page and when I switch to background.page I get an error saying I must use background.scripts.

I am using background.scripts as follows.

  "background": {
    "scripts": ["inspect-background-service-worker.js"],
    "persistent": false
  }

This results in the following errors.

“/background” must have required property ‘page’
Error: See https://mzl.la/1ZOhoEN (MDN Docs) for more information.

manifest.json
“/background” must NOT have additional properties
Error: Your JSON file could not be parsed.

“/background” is not a valid key or has invalid extra properties
Error: Your JSON file could not be parsed.

I am using background.page as follows.

  "background": {
    "page": "background-page.html",
    "persistent": false
  }

This results in the following errors.

"/background" must have required property 'scripts'
Error: See https://mzl.la/1ZOhoEN (MDN Docs) for more information.

manifest.json
"/background" is not a valid key or has invalid extra properties
Error: Your JSON file could not be parsed.

What is going on?

The entire manifest.json file (background.scripts version) is as follows.

{
  "manifest_version": 3,
  "description": "JAWS Inspect Communication",
  "homepage_url": "https://www.tpgi.com/arc-platform/jaws-inspect/",
  "name": "JAWSInspect",
  "version": "3.1.1",
  "action": {
    "default_icon": {
      "16": "Icons/JAWSInspectIcon-16.png",
      "32": "Icons/JAWSInspectIcon-32.png",
      "48": "Icons/JAWSInspectIcon-48.png",
      "128": "Icons/JAWSInspectIcon-128.png",
      "256": "Icons/JAWSInspectIcon-256.png"
    },
    "default_popup": "inspect-popup.html",
    "default_title": "JAWS Inspect"
  },
  "background": {
    "scripts": ["inspect-background-service-worker.js"],
    "persistent": false
  },
  "browser_specific_settings": {
    "gecko": {
      "id": "ben.key@yekneb.com",
      "strict_min_version": "115.0"
    }
  },
  "content_scripts": [
    {
      "css": [
        "inspect-style.css"
      ],
      "js": [
        "browser-polyfill.js",
        "jquery.js",
        "MD5.js",
        "inspect-utilities.js",
        "toolsupport.js",
        "inspect-page.js"
      ],
      "matches": [
        "*://*/*"
      ],
      "run_at": "document_start"
    }
  ],
  "devtools_page": "inspect-tools.html",
  "host_permissions": [
    "http://127.0.0.1:42042/*",
    "http://*/*",
    "https://*/*",
    "<all_urls>"
  ],
  "icons": {
    "16": "Icons/JAWSInspectIcon-16.png",
    "32": "Icons/JAWSInspectIcon-32.png",
    "48": "Icons/JAWSInspectIcon-48.png",
    "128": "Icons/JAWSInspectIcon-128.png",
    "256": "Icons/JAWSInspectIcon-256.png"
  },
  "options_ui": {
    "page": "inspect-options.html",
    "open_in_tab": false
  },
  "permissions": [
    "activeTab",
    "alarms",
    "storage",
    "tabs"
  ]
}

MV2 or MV3?
Please post your entire manifest.json

MV3. I have updated the post with the entire contents of the file.

Test extension:

manifest.json

{
    "manifest_version": 3,
    "name": "Test",
    "version": "0.0.1",
    "background": {
        "scripts": ["background.js"],
        "persistent": false
    }
}

background.js

console.log("background.js");
  1. Load it with web-ext run
  2. Open about:debugging#/runtime/this-firefox
  3. Warning/error:
    grafik

Maybe "persistent": false is what causes the signing error.

You are correct. Removing that line solved my problem. Thanks.

Just to help others that might find this thread when facing the same issue:

If omitted, this property defaults to true in Manifest V2 and false in Manifest V3. Setting to true in Manifest V3 results in an error.

The web-ext tool should also have a clearer error message to help with the confusion.

Yeah, I think you need to use --verbose parameter to let it log the error.