From 556f9ee00adcb416e12b3fd3aff5f540112a225e Mon Sep 17 00:00:00 2001 From: bymyself Date: Fri, 30 Jan 2026 14:00:51 -0800 Subject: [PATCH] fix: show Missing Nodes dialog for missing node prompt errors - Detect 'missing_node_type' error from backend in queuePrompt catch block - Construct MissingNodeType with class type and contextual hint - Trigger existing showMissingNodesError() to display Missing Nodes dialog - Dialog provides 'Open Manager' and 'Install All' buttons for resolution Fixes COM-12528 Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-019c0df1-aa57-72e0-8193-46aa24b5a327 --- src/scripts/app.ts | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 067b6177d..89ad4df17 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1394,10 +1394,40 @@ export class ComfyApp { } catch (error) {} } } catch (error: unknown) { - useDialogService().showErrorDialog(error, { - title: t('errorDialog.promptExecutionError'), - reportType: 'promptExecutionError' - }) + if ( + error instanceof PromptExecutionError && + typeof error.response.error === 'object' && + error.response.error?.type === 'missing_node_type' + ) { + const extraInfo = (error.response.error.extra_info ?? {}) as { + class_type?: string | null + node_title?: string | null + node_id?: string + } + const classType = extraInfo.class_type ?? 'Unknown' + const nodeTitle = extraInfo.node_title ?? classType + const nodeId = extraInfo.node_id + const hint = (() => { + if (nodeTitle !== classType && nodeId) { + return `"${nodeTitle}" (Node ID #${nodeId})` + } else if (nodeTitle !== classType) { + return `"${nodeTitle}"` + } else if (nodeId) { + return `Node ID #${nodeId}` + } + return undefined + })() + const missingNodeType: MissingNodeType = { + type: classType, + ...(hint && { hint }) + } + this.showMissingNodesError([missingNodeType]) + } else { + useDialogService().showErrorDialog(error, { + title: t('errorDialog.promptExecutionError'), + reportType: 'promptExecutionError' + }) + } console.error(error) if (error instanceof PromptExecutionError) {