n8n-io/n8n · warning · UnsupportedOperationError
Operation not supported: dialog
Error message
Operation not supported: dialog
What it means
Thrown as UnsupportedOperationError('dialog', 'agent-browser') by the agent-browser adapter's dialog() stub. The agent-browser CLI has no JavaScript dialog (alert/confirm/prompt) handling, so the adapter explicitly rejects the operation. UnsupportedOperationError extends McpBrowserError. The Playwright adapter supports dialog handling; agent-browser does not.
Source
Thrown at packages/@n8n/mcp-browser/src/adapters/agent-browser.ts:426
'scroll',
options?.direction ?? 'down',
String(options?.amount ?? 300),
]);
}
}
async upload(
_pageId: string,
_target: ElementTarget | undefined,
_files: string[],
): Promise<void> {
await Promise.resolve();
throw new UnsupportedOperationError('upload', this.name);
}
async dialog(_pageId: string, _action: 'accept' | 'dismiss', _text?: string): Promise<string> {
await Promise.resolve();
throw new UnsupportedOperationError('dialog', this.name);
}
// =========================================================================
// Inspection
// =========================================================================
async snapshot(
pageId: string,
_target?: ElementTarget,
interactive = true,
): Promise<SnapshotResult> {
await this.switchToTab(pageId);
const args = interactive ? ['snapshot', '-i'] : ['snapshot'];
const response = await this.run(args);
const tree =
typeof response.data === 'string' ? response.data : JSON.stringify(response.data ?? '');
const refCount = (tree.match(/@e\d+/g) ?? []).length;
return { tree: tree || '(empty page)', refCount };View on GitHub (pinned to 5ac6606e81)
Solutions
- Switch to the Playwright adapter for sessions that may encounter JS dialogs.
- Gate dialog handling behind adapter.name === 'playwright' before calling.
- For agent-browser, dismiss dialogs manually via evaluate() that overrides window.alert/confirm, or accept them in the browser UI.
Example fix
// before
await adapter.dialog(pageId, 'accept');
// after — dismiss via eval on agent-browser
if (adapter.name === 'agent-browser') {
await adapter.evaluate(pageId, 'window.confirm = () => true;');
} else {
await adapter.dialog(pageId, 'accept');
} Defensive patterns
Strategy: validation
Validate before calling
function adapterSupportsDialog(name: string): boolean {
return name === 'playwright';
} Type guard
function supportsDialog(adapter: Adapter): boolean {
return adapter.name !== 'agent-browser';
} Prevention
- Check adapter.name before calling dialog().
- On agent-browser, override window.alert/confirm via evaluate() as a workaround.
- Use the Playwright adapter for sessions that may hit JS dialogs.
When it happens
Trigger: Calling adapter.dialog(pageId, 'accept' | 'dismiss', text?) on an AgentBrowserAdapter instance. The method awaits a resolved promise then throws synchronously.
Common situations: A page showed a JS alert/confirm and the tool layer tried to dismiss it generically; migrating from Playwright adapter to agent-browser; an LLM emitted a dialog tool call against an agent-browser session.
Related errors
- Operation not supported: drag
- Operation not supported: upload
- Operation not supported: pdf
- agent-browser failed
- Page not found: ${pageId}
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/5b4cbdd693b4d888.
Report an issue: GitHub.