RocketChat/Rocket.Chat · error · Error
Type not supported
Error message
Type not supported
What it means
Thrown by the UiKit interaction endpoint POST /api/apps/ui.interaction/:id when req.body.type is not one of the three handled cases: 'blockAction', 'viewSubmit', or 'viewClosed'. The switch falls through to default. The outer catch converts it to a 500 response with { error: 'Type not supported' }. This route is only reached for apps registered as core UiKit apps (UiKitCoreApp.isRegistered(appId) is true); otherwise next() is called.
Source
Thrown at apps/meteor/ee/server/apps/communication/uikit.ts:192
const result = await UiKitCoreApp.viewClosed({
appId,
triggerId,
type,
user,
payload: {
view,
isCleared,
},
});
// Using ?? to always send something in the response, even if the app had no result.
res.send(result ?? {});
return;
}
default:
throw new Error('Type not supported');
}
} catch (e) {
const error = e instanceof Error ? e.message : e;
res.status(500).send({ error });
}
});
export class AppUIKitInteractionApi {
orch: IAppServerOrchestrator;
constructor(orch: IAppServerOrchestrator) {
this.orch = orch;
router.post('/:id', this.routeHandler.bind(this));
}
private async routeHandler(
req: UiKitUserInteractionRequest,View on GitHub (pinned to f9d3ec372b)
Solutions
- Ensure body.type is exactly 'blockAction', 'viewSubmit', or 'viewClosed' (case-sensitive).
- Update the client SDK / app to a version whose interaction types match the server.
- If you need a new interaction type, it must be added to the switch in apps/meteor/ee/server/apps/communication/uikit.ts.
- For non-core apps, ensure the app is NOT registered as a core UiKit app if you want the orchestrator route handler instead.
Example fix
// before
fetch('/api/apps/ui.interaction/' + appId, {
method: 'POST',
body: JSON.stringify({ type: 'blockActions', actionId: 'go' }) // typo
});
// after
fetch('/api/apps/ui.interaction/' + appId, {
method: 'POST',
body: JSON.stringify({ type: 'blockAction', actionId: 'go' })
}); Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_UITKIT_TYPES = new Set(['blockAction', 'viewSubmit', 'viewClosed']);
function isValidInteraction(body: unknown): boolean {
return typeof body === 'object' && body !== null &&
SUPPORTED_UITKIT_TYPES.has((body as any).type);
}
if (!isValidInteraction(req.body)) {
return res.status(400).send({ error: 'Unsupported interaction type' });
} Type guard
type SupportedUiKitType = 'blockAction' | 'viewSubmit' | 'viewClosed'; const isSupportedUiKitType = (t: unknown): t is SupportedUiKitType => typeof t === 'string' && ['blockAction', 'viewSubmit', 'viewClosed'].includes(t);
Try / catch
try {
await fetch(`/api/apps/ui.interaction/${appId}`, { method: 'POST', body: JSON.stringify(payload) });
} catch (e) {
if (e instanceof Error && /Type not supported/i.test(e.message)) {
// client sent an unknown body.type - fix the payload, do not retry as-is
}
} Prevention
- Validate body.type client-side against the three supported values before posting.
- Keep client SDK and server versions aligned to avoid new-type skew.
- Add the type to the switch in uikit.ts if you genuinely need a new interaction type.
- Return 400 (not 500) for unsupported types if you control the handler.
When it happens
Trigger: POST /api/apps/ui.interaction/<appId> with a body whose type field is missing, undefined, or an unsupported value (e.g. 'modalAction', 'datepicker', a typo like 'blockActions'). The appId must resolve to a registered core UiKit app for this handler to run.
Common situations: App developer sends a new/undocumented interaction type; client SDK version sends a type the server does not yet recognize (version skew); typo in a hand-built payload; missing type field entirely.
Related errors
- Invalid Api parameter provided, it must be a valid IApi obje
- Invalid command parameter provided, must be a string.
- Invalid Slash Command parameter provided, it must be a valid
- The environmental variable "${envVarName}" is not readable.
- auth option should be of the form "username:password"
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/0828a68ffef77aae.
Report an issue: GitHub.