"Fix node (recreate)" throws on frontend 1.47+ (string node ids), leaves duplicate node on canvas
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start in js/node_fixer.js at node_info_copy() and the callback that creates the replacement node. Reproduce the issue with a connected input, then verify that recreation no longer throws, leaves only one node on the canvas, and preserves the expected connections for both input and output links.
Written by the indexing model from the issue text.
Description
What happens
Right-clicking a node with a connected input and choosing "Fix node (recreate)" throws instead of finishing, and the graph ends up with two copies of the node: the original (still wired) and an unconnected replacement stacked on top of it.
Console:
TypeError: t.findInputSlot is not a function
at LGraphNode.connect
at node_info_copy (node_fixer.js)
at callback (node_fixer.js)
Root cause
In js/node_fixer.js, node_info_copy() reconnects inputs like this:
let src_node = app.graph.getNodeById(link.origin_id);
src_node.connect(link.origin_slot, dest.id, input.name);
dest.id is passed instead of dest itself. Node ids are strings on current frontend versions, and LGraphNode.connect() only resolves its second argument to a node when it's a number — a string id sails past that resolution and connect() ends up calling findInputSlot on the id string, which throws.
The callback also creates the replacement node and copies data into it before removing the original:
let new_node = LiteGraph.createNode(nodeType.comfyClass);
app.canvas.graph.add(new_node, false);
node_info_copy(this, new_node, true);
app.canvas.graph.remove(this);
Since the exception happens inside node_info_copy, graph.remove(this) on the next line never runs, so the original node is never cleaned up. That's the duplicate.
Not specific to any one custom node pack — this happens to any node with a connected input.
Suggested fix
- In
node_info_copy, passdest(the node object) toconnect(), notdest.id. Same for the output-side loop below it, which already does this correctly (dest.connect(parseInt(i), target_node, link.target_slot)— target_node is an object there, not an id). - Move
app.canvas.graph.remove(this)to before the reconnect calls (or at least before the input-copy loop), so a failure partway through doesn't leave both nodes on the canvas. An input only holds one link, so reconnecting before removing the old node fights the link still attached to it anyway.
To reproduce
- Add any node with a widget/input, connect something into it.
- Right-click → "Fix node (recreate)".
- Console throws
findInputSlot is not a function; two copies of the node are left on the canvas, only one still wired.
Frontend version: 1.47.11. Related but not the same bug: #380 (stale link objects after recreate, filed against an older frontend) and the now-closed #1872 (wrong link position after recreate, frontend 1.19.9) — neither describes this specific string-id/exception path.
Happy to open a PR with the two-line fix above if that's useful.
- Dominant language
- Python
- Stars
- 16.2k
- Forks
- 2.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 18
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Comfy-Org/ComfyUI-Manager
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Comfy-Org/ComfyUI-Manager#3272 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Comfy-Org/ComfyUI-Manager#3259 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Comfy-Org/ComfyUI-Manager#3256 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Comfy-Org/ComfyUI-Manager#3223 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Comfy-Org/ComfyUI-Manager#3220 · 1 comment ·
All issues in Comfy-Org/ComfyUI-Manager
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100