alarms[name] will return 'undefined' so it will error when it tries to access timeoutId of 'undefined'. The error message isn't particularly helpful in this case so I modified it to give the same error as desktop chrome.