{"record":{"id":"c45c1e69da320428","repo":"louislam/uptime-kuma","slug":"notification-type-is-not-supported","errorCode":null,"errorMessage":"Notification type is not supported","messagePattern":"Notification type is not supported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/notification.js","lineNumber":254,"sourceCode":"            }\n            this.providerList[item.name] = item;\n        }\n    }\n\n    /**\n     * Send a notification\n     * @param {BeanModel} notification Notification to send\n     * @param {string} msg General Message\n     * @param {object} monitorJSON Monitor details (For Up/Down only)\n     * @param {object} heartbeatJSON Heartbeat details (For Up/Down only)\n     * @returns {Promise<string>} Successful msg\n     * @throws Error with fail msg\n     */\n    static async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {\n        if (this.providerList[notification.type]) {\n            return this.providerList[notification.type].send(notification, msg, monitorJSON, heartbeatJSON);\n        } else {\n            throw new Error(\"Notification type is not supported\");\n        }\n    }\n\n    /**\n     * Save a notification\n     * @param {object} notification Notification to save\n     * @param {?number} notificationID ID of notification to update\n     * @param {number} userID ID of user who adds notification\n     * @returns {Promise<Bean>} Notification that was saved\n     */\n    static async save(notification, notificationID, userID) {\n        let bean;\n\n        if (notificationID) {\n            bean = await R.findOne(\"notification\", \" id = ? AND user_id = ? \", [notificationID, userID]);\n\n            if (!bean) {\n                throw new Error(\"notification not found\");","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification.js#L236-L272","documentation":"Thrown by Notification.send when notification.type does not correspond to any registered provider name in the providerList. The providerList is keyed by each provider's `name` field during init(); an unknown type means the value was never registered (removed provider, corrupted row, or external caller passing an ad-hoc type).","triggerScenarios":"A notification bean in the DB has a type string that no longer matches any provider (e.g. provider was renamed/removed in a newer Uptime Kuma version), or an API caller posts a notification with a fabricated type. Also possible if Notification.init() was not called before send().","commonSituations":"Upgrade removed a provider whose notifications still exist in the DB, manual DB edits changing the type, or a custom provider not added to the list in notification.js:123.","solutions":["Check the notification row's type value in the DB and compare it against the registered provider names (see notification.js:123-228).","If the provider was removed in an upgrade, delete the orphaned notification or migrate it to a supported type.","If adding a custom provider, register it in the list inside Notification.init() with a unique name.","Ensure Notification.init() runs at startup before any send() call."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure init() ran and the requested type is registered before dispatch\nfunction isRegisteredProvider(type, providerList) {\n    return Object.prototype.hasOwnProperty.call(providerList, type);\n}\nif (!isRegisteredProvider(notification.type, Notification.providerList)) {\n    throw new Error(`Notification type '${notification.type}' is not supported`);\n}","typeGuard":"/** Narrows to a type string backed by a registered provider. */\nfunction isSupportedNotificationType(type, providerList) {\n    return typeof type === \"string\" && Object.prototype.hasOwnProperty.call(providerList, type);\n}","tryCatchPattern":"if (!isSupportedNotificationType(notification.type, this.providerList)) {\n    throw new Error(`Notification type '${notification.type}' is not supported`);\n}\nreturn this.providerList[notification.type].send(notification, msg, monitorJSON, heartbeatJSON);","preventionTips":["Run Notification.init() at startup before any send call.","After upgrades, prune notification rows whose type was removed.","Register custom providers with a unique name in init()."],"tags":["notification","registry","config","provider-not-found"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}