Trung0246 / ComfyUI-0246

Random nodes for ComfyUI
MIT License
113 stars 11 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'extra') #12

Closed cliffrowley closed 12 months ago

cliffrowley commented 12 months ago

I just loaded up on a different browser to test some things with another node (tried Chrome and Brave), and I'm getting a client side error. Not sure why I'm not getting it in my usual browser (Safari), though. I haven't used ComfyUI in either of those browsers previously, so I'm not sure if that makes a difference.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'extra')
    at Object.error_flag [as pre] (nodes.js:120:17)
    at obj.<computed> [as loadGraphData] (nodes.js:52:16)
    at HTMLButtonElement.onclick (ui.js:789:17)

Turns out it's being thrown here: https://github.com/Trung0246/ComfyUI-0246/blob/6d40ba27fd7c9ec9bedb42d7a43eecd53617db66/web/js/nodes.js#L120

cliffrowley commented 12 months ago

Just did a little extra testing, by disabling the node, restarting ComfyUI, then refreshing one of the browsers so it loads the default workflow, then re-enabling the node and restarting ComfyUI and yes, it does appear that this error only occurs if no workflow has been loaded previously (which also explains why I didn't see the error in Safari). As expected, the error still occurs in the browser that I didn't refresh while the node was disabled.

Trung0246 commented 12 months ago

Huh weird, the workflow should have that key by default when being exported. I guess sometimes comfyui did not do it sometimes. Also yeah I guess I forgot to handle the null workflow.

Trung0246 commented 12 months ago

Anyways quick fixed.