The populate() function set `this.widgets.length = 1` to preserve a
first widget, but the ShowText node has no initial widgets (its text
input uses forceInput), so this created an `undefined` entry at
index 0. The new ComfyUI frontend (comfyui-frontend-package >= 1.x)
iterates all widgets during layout (#arrangeWidgets) and crashes on the
undefined entry, causing the canvas to stop rendering entirely.
- Start cleanup loop at index 0 and clear to length 0
- Add safe-navigation when calling onRemove on potentially undefined widgets
- Fall back to w.element when w.inputEl is unavailable for
forward-compatibility with the new frontend widget API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>