{"record":{"id":"058bf3fcc1fb9197","repo":"RocketChat/Rocket.Chat","slug":"could-not-get-the-message-converter-to-process-liv","errorCode":null,"errorMessage":"Could not get the message converter to process livechat room messages","messagePattern":"Could not get the message converter to process livechat room messages","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/livechat.ts","lineNumber":401,"sourceCode":"\t\t\t.convertDepartment(await LivechatDepartment.findOneByIdOrName<ILivechatDepartment>(value, {}));\n\t}\n\n\tprotected async findDepartmentsEnabledWithAgents(appId: string): Promise<Array<IDepartment>> {\n\t\tthis.orch.debugLog(`The App ${appId} is looking for livechat departments.`);\n\n\t\tconst converter = this.orch.getConverters()?.get('departments');\n\t\t// #TODO: #AppsEngineTypes - Remove explicit types and typecasts once the apps-engine definition/implementation mismatch is fixed.\n\t\tconst boundConverter = converter.convertDepartment.bind(converter) as (_: ILivechatDepartment) => Promise<IDepartment>;\n\n\t\treturn Promise.all((await LivechatDepartment.findEnabledWithAgents().toArray()).map(boundConverter));\n\t}\n\n\tprotected async _fetchLivechatRoomMessages(appId: string, roomId: string): Promise<Array<IAppsEngineMessage>> {\n\t\tthis.orch.debugLog(`The App ${appId} is getting the transcript for livechat room ${roomId}.`);\n\t\tconst messageConverter = this.orch.getConverters()?.get('messages');\n\n\t\tif (!messageConverter) {\n\t\t\tthrow new Error('Could not get the message converter to process livechat room messages');\n\t\t}\n\n\t\tconst livechatMessages = await getRoomMessages({ rid: roomId });\n\t\treturn Promise.all(await livechatMessages.map((message) => messageConverter.convertMessage(message, livechatMessages)).toArray());\n\t}\n\n\tprotected async setCustomFields(\n\t\tdata: { token: IVisitor['token']; key: string; value: string; overwrite: boolean },\n\t\tappId: string,\n\t): Promise<number> {\n\t\tthis.orch.debugLog(`The App ${appId} is setting livechat visitor's custom fields.`);\n\n\t\treturn setCustomFields(data);\n\t}\n}\n","sourceCodeStart":383,"sourceCodeEnd":417,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/app/apps/server/bridges/livechat.ts#L383-L417","documentation":"Error \"Could not get the message converter to process livechat room messages\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/app/apps/server/bridges/livechat.ts:401 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the apps-engine orchestrator is initialized and the 'messages' converter is registered before fetching livechat room messages.","Check app initialization order; retry after the orchestrator has finished loading converters."],"exampleFix":"Ensure the message converter is registered in the converter map before use: const converter = this.getMessageConverter(); if (!converter) { throw new Error('Could not get the message converter to process livechat room messages'); }","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}