-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Description
When loading a workflow that contains promoted widgets, the following error occurs:
TypeError: input._listenerController?.abort is not a function
at #addSubgraphInputListeners (SubgraphNode.ts:104:32)
at ComfyNode._internalConfigureAfterSlots (SubgraphNode.ts:169:12)
at ComfyNode.configure (LGraphNode.ts:761:10)
Steps to Reproduce
- Create a subgraph with DOM widgets
- Connect a DOM widget to a subgraph input (promoting it)
- Save the workflow
- Reload the page or load the saved workflow
- Error occurs during deserialization
Root Cause
The _listenerController
property on input slots is not serialized/deserialized. When loading a workflow:
- Input slots are plain objects from JSON
- They don't have
_listenerController
property - Code assumes optional chaining (
?.
) is enough, butabort
might not be a function - This happens in 3 places:
#addSubgraphInputListeners
,configure
, andonRemoved
Expected Behavior
Workflows with promoted widgets should load without errors.
Actual Behavior
TypeError is thrown because the code tries to call abort()
on a non-existent or non-AbortController object.
Solution
Add proper type checking before calling abort:
// Instead of:
input._listenerController?.abort()
// Use:
if (input._listenerController && typeof input._listenerController.abort === 'function') {
input._listenerController.abort()
}
This needs to be fixed in:
SubgraphNode.#addSubgraphInputListeners
(line 104)SubgraphNode.configure
(line 142)SubgraphNode.onRemoved
(line 356)
Environment
- litegraph.js version: 0.16.9
- Affects: All browsers
- Severity: High (breaks workflow loading)
Metadata
Metadata
Assignees
Labels
No labels