solid-dnd icon indicating copy to clipboard operation
solid-dnd copied to clipboard

Intermittent error from removeDraggable

Open floer32 opened this issue 3 years ago • 3 comments

This is probably self-inflicted due to a usage error on my part, but I'm seeing this sometimes (and it breaks behavior):

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_pendingCleanup')
    at updatePath (dev.js:168:12)
    at updatePath (dev.js:165:7)
    at updatePath (dev.js:165:7)
    at dev.js:193:17
    at batch (dev.js:415:14)
    at setStore (dev.js:193:5)
    at removeDraggable (drag-drop-context.jsx:91:9)
    at Array.<anonymous> (create-draggable.js?t=1652401249008:19:21)
    at cleanNode (dev.js:936:62)
    at cleanNode (dev.js:932:45)

Is it possible that no cleanup is required in that case? (Could it soft-fail?)

floer32 avatar May 13 '22 03:05 floer32

Looks like you are attempting to remove a draggable that doesn't exist (though the error could be better here).

Are you calling removeDraggable manually perhaps?

I guess we should check the draggable exists and issue a warning when attempting to remove one that doesn't.

martinpengellyphillips avatar May 13 '22 10:05 martinpengellyphillips

I'm not manually calling removeDraggable, but maybe it's being called redundantly for some reason. If it's possible to soft-fail with a warning, it seems like it would solve it in my case.

floer32 avatar May 13 '22 18:05 floer32

I'll be cutting a new release soon so will try to add that in.

martinpengellyphillips avatar May 15 '22 18:05 martinpengellyphillips

Better late than never? 😂

Warnings added in 0.7.1

martinpengellyphillips avatar Sep 11 '22 20:09 martinpengellyphillips