First Firefox extension test not going well

I am writing a first test of a firefox extension. I am using the following websites as assistance:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items

https://github.com/mdn/webextensions-examples/blob/main/menu-demo/background.js

Here is my code:

mainfest.json

{
  "manifest_version":2,
  "version":"1.0",
  "name":"Test",
  "content_scripts":[
    {
     "matches":["<all_urls>"],
     "js":["main.js"]
    }
  ],
  "permissions":["contextMenus"]
}

main.js

alert("test");

function onError(error) {
  alert(error);
}

browser.contextMenus.create(
  {
    id: "AlertTest",
    title: "Test2",
    contexts: ["all"],
  },
  onCreated,
);

alert("Test 2");

browser.contextMenus.onClicked.addListener((info, tab) => {
  switch (info.menuItemId) {
    case "AlertTest":
      console.log(info.selectionText);
      alert("The test extension is up and running");
      break;
  }
});

The extension does load, but i never get to alert(“Test 2”);. In addition the console says “TypeError: browser.contextMenus is undefined”. Please let me know what I’m doing wrong.