I am working on my first Chrome extension to popup an alert. On my background.js I get the following message when I add my files Chrome extentions: Uncaught TypeError: Cannot read properties of undefined (reading 'onAlarm').
'use strict';
function setAlarm() {
let minutes = parseFloat($("#time").val())
chrome.alarms.create('reminderAlarm', {
periodInMinutes: minutes
})
window.close()
}
$("#submit").click(setAlarm)
Any idea how to fix it? I attach an image of the error and code.