If you upload a CSV file with tags, the console will display an error after a successful upload.
Here is some digging.
The underlying issue is essentially that the modal closes too fast with the current logic.
The error happens in uppy-upload.js.
The properties failed to be set because the element (uppy-upload) was already destroyed.
How is it possible? this._uppyInstance?.cancelAll();
For reference, _reset is called from _allUploadsComplete.
On successful upload, this is the order of functions: uploadDone → _allUploadsComplete → [ _reset]
When uploadDone is called, the modal is closed right away.
This means that the uppy-upload element will be destroyed at the end of the frame.
Back to this._uppyInstance?.cancelAll();. This will trigger the event below.
That’s the reason why it fails. Because of run(), the properties will be set after the element is destroyed.
this._uppyInstance.on("file-removed", (file, reason) => {
// we handle the cancel-all event specifically, so no need
// to do anything here. this event is also fired when some files
// are handled by an upload handler
if (reason === "cancel-all") {
return;
}
run(() => {
I’m not sure if there is a better solution. So, I’m posting here.
That’s a lot of text for a non-blocking minor issue, but it was not initially evident.