Uppy: Error: Cannot read property 'id' of undefined when uppy.cancelAll() is called

Created on 8 Oct 2019  路  6Comments  路  Source: transloadit/uppy

First, I want to start by thanking you guys for working on such great file upload package.

To reproduce the issue try to upload multiple files using the AWS S3 provider

  • Drag & drop multiple files into the file uploader or use the open file dialog.
  • Abort/Cancel the upload using uppy.cancelAll()
  • the file uploader will show an error alert Cannot read property 'id' of undefined

Please see the screenshots

The error alert

Annotation 2019-10-08 160746

the thrown error

Annotation 2019-10-08 160437

The block of code that caused it

Annotation 2019-10-08 160502

maybe changing this condition https://github.com/transloadit/uppy/blob/1dd4d79aa79526cc52e516f7126e71d492b5f83c/packages/%40uppy/core/src/index.js#L855

to something like

if (!file || !this.getFile(file.id)) {
  this.log(`Not setting progress for a file that has been removed: ${file.id}`)
   return
}

may solve it?

AWS S3 Bug

Most helpful comment

That check would work, but I think we should do it in the AwsS3 plugin itself, and not emit the preprocess-complete event if the file doesn't exist anymore:
https://github.com/transloadit/uppy/blob/733de659da17ee77afba9882633477fb7cd778dd/packages/%40uppy/aws-s3/src/index.js#L172-L175

(That if() statement in @uppy/core is a hack to try to paper over these bugs :disappointed: we should avoid emitting events with removed file objects as much as possible!)

@VivekSingh777 please do! lmk if you need any more pointers

All 6 comments

Can I work on this issue?

That check would work, but I think we should do it in the AwsS3 plugin itself, and not emit the preprocess-complete event if the file doesn't exist anymore:
https://github.com/transloadit/uppy/blob/733de659da17ee77afba9882633477fb7cd778dd/packages/%40uppy/aws-s3/src/index.js#L172-L175

(That if() statement in @uppy/core is a hack to try to paper over these bugs :disappointed: we should avoid emitting events with removed file objects as much as possible!)

@VivekSingh777 please do! lmk if you need any more pointers

Thanks @goto-bus-stop and @VivekSingh777 for working/looking into this bug.

@VivekSingh777 I can help with this. Do you have a draft PR?

Any updates on this one? We would like to help out, but I probably need a little more direction to get started. Thanks!

Hi Everybody. Any updates?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enneid picture enneid  路  4Comments

rrjanbiah picture rrjanbiah  路  3Comments

evanoberholster picture evanoberholster  路  3Comments

yaegor picture yaegor  路  3Comments

ameft picture ameft  路  4Comments