{"record":{"id":"fe7ea9a7ad57c4cd","repo":"RocketChat/Rocket.Chat","slug":"custom-emoji-error-name-or-alias-already-in-use","errorCode":"Custom_Emoji_Error_Name_Or_Alias_Already_In_Use","errorMessage":"The custom emoji or one of its aliases is already in use","messagePattern":"The custom emoji or one of its aliases is already in use","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/media/emoji-custom/lib/insertOrUpdateEmoji.ts","lineNumber":76,"sourceCode":"\t\t\t\tinput: emojiData.aliases,\n\t\t\t\tfield: 'Alias_Set',\n\t\t\t});\n\t\t}\n\t\taliases = emojiData.aliases\n\t\t\t.split(/\\s*,\\s*/)\n\t\t\t.filter(Boolean)\n\t\t\t.map((alias) => limax(alias, { replacement: '_' }))\n\t\t\t.filter((alias) => alias !== emojiData.name);\n\t}\n\n\temojiData.extension = emojiData.extension === 'svg+xml' ? 'png' : emojiData.extension;\n\n\tconst conflictingEmoji = await EmojiCustom.findOneByNamesOrAliases([emojiData.name, ...aliases], emojiData._id, {\n\t\tprojection: { _id: 1 },\n\t});\n\n\tif (conflictingEmoji) {\n\t\tthrow new Meteor.Error('Custom_Emoji_Error_Name_Or_Alias_Already_In_Use', 'The custom emoji or one of its aliases is already in use', {\n\t\t\tmethod: 'insertOrUpdateEmoji',\n\t\t});\n\t}\n\n\tif (typeof emojiData.extension === 'undefined') {\n\t\tthrow new Meteor.Error('error-the-field-is-required', 'The custom emoji file is required', {\n\t\t\tmethod: 'insertOrUpdateEmoji',\n\t\t});\n\t}\n\n\tif (!emojiData._id) {\n\t\t// insert emoji\n\t\tconst createEmoji = {\n\t\t\tname: emojiData.name,\n\t\t\taliases,\n\t\t\textension: emojiData.extension,\n\t\t};\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/emoji-custom/lib/insertOrUpdateEmoji.ts#L58-L94","documentation":"Error \"The custom emoji or one of its aliases is already in use\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/media/emoji-custom/lib/insertOrUpdateEmoji.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different emoji name or aliases; an existing custom emoji already uses that name or one of the aliases.","Remove the conflicting alias or rename the existing custom emoji first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}