RocketChat/Rocket.Chat · error · Error

Could not get the message converter to process livechat…

Error message

Could not get the message converter to process livechat room messages

What it means

Error "Could not get the message converter to process livechat room messages" thrown in RocketChat/Rocket.Chat.

Solutions

  1. Ensure the apps-engine orchestrator is initialized and the 'messages' converter is registered before fetching livechat room messages.
  2. Check app initialization order; retry after the orchestrator has finished loading converters.

Example fix

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'); }

When it happens

Trigger: Thrown at apps/meteor/app/apps/server/bridges/livechat.ts:401 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of RocketChat/Rocket.Chat@2a7de45707 (2026-08-18). Data as JSON: /api/errors/058bf3fcc1fb9197. Report an issue: GitHub.

Appendix: source

Thrown at apps/meteor/app/apps/server/bridges/livechat.ts:401

			.convertDepartment(await LivechatDepartment.findOneByIdOrName<ILivechatDepartment>(value, {}));
	}

	protected async findDepartmentsEnabledWithAgents(appId: string): Promise<Array<IDepartment>> {
		this.orch.debugLog(`The App ${appId} is looking for livechat departments.`);

		const converter = this.orch.getConverters()?.get('departments');
		// #TODO: #AppsEngineTypes - Remove explicit types and typecasts once the apps-engine definition/implementation mismatch is fixed.
		const boundConverter = converter.convertDepartment.bind(converter) as (_: ILivechatDepartment) => Promise<IDepartment>;

		return Promise.all((await LivechatDepartment.findEnabledWithAgents().toArray()).map(boundConverter));
	}

	protected async _fetchLivechatRoomMessages(appId: string, roomId: string): Promise<Array<IAppsEngineMessage>> {
		this.orch.debugLog(`The App ${appId} is getting the transcript for livechat room ${roomId}.`);
		const messageConverter = this.orch.getConverters()?.get('messages');

		if (!messageConverter) {
			throw new Error('Could not get the message converter to process livechat room messages');
		}

		const livechatMessages = await getRoomMessages({ rid: roomId });
		return Promise.all(await livechatMessages.map((message) => messageConverter.convertMessage(message, livechatMessages)).toArray());
	}

	protected async setCustomFields(
		data: { token: IVisitor['token']; key: string; value: string; overwrite: boolean },
		appId: string,
	): Promise<number> {
		this.orch.debugLog(`The App ${appId} is setting livechat visitor's custom fields.`);

		return setCustomFields(data);
	}
}

View on GitHub (pinned to 2a7de45707)