RocketChat/Rocket.Chat · error · Error
Visitor with id not found
Error message
Visitor with id ${visitorId} not found What it means
Error "Visitor with id ${visitorId} not found" thrown in RocketChat/Rocket.Chat.
Solutions
- Verify the visitorId passed in the IPostLivechatGuestSaved event payload refers to an existing livechat visitor in the database.
- Ensure the visitor was not deleted between the event being fired and the listener executing; re-register the visitor if needed.
Example fix
Verify the visitorId exists before calling: const visitor = await LivechatVisitors.findOneById(visitorId); if (!visitor) { throw new Error(`Visitor with id ${visitorId} not found`); } When it happens
Trigger: Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:466 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/293920c20463efc7.
Report an issue: GitHub.
Appendix: source
Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:466
}
return this.orch
.getManager()
.getListenerManager()
.executeListener(args.event, {
room,
from: from as NonNullable<typeof from>, // type definition in the apps-engine seems to be incorrect
to,
type: transferData.type,
});
}
case AppInterface.IPostLivechatGuestSaved: {
const [visitorId] = args.payload;
const visitor = await this.orch.getConverters().get('visitors').convertById(visitorId);
if (!visitor) {
throw new Error(`Visitor with id ${visitorId} not found`);
}
return this.orch.getManager().getListenerManager().executeListener(args.event, visitor);
}
case AppInterface.IPostLivechatRoomSaved: {
const [roomId] = args.payload;
const room = await this.orch.getConverters().get('rooms').convertById(roomId);
if (!room) {
throw new Error(`Room with id ${roomId} not found`);
}
return this.orch
.getManager()
.getListenerManager()
.executeListener(args.event, room as IAppsLivechatRoom);
}View on GitHub (pinned to b2c16d5842)