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

  1. Ensure body.type is exactly 'blockAction', 'viewSubmit', or 'viewClosed' (case-sensitive).
  2. Update the client SDK / app to a version whose interaction types match the server.
  3. If you need a new interaction type, it must be added to the switch in apps/meteor/ee/server/apps/communication/uikit.ts.
  4. 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

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


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/0828a68ffef77aae. Report an issue: GitHub.