transloadit / uppy

The next open source file uploader for web browsers :dog:
https://uppy.io
MIT License
28.98k stars 1.99k forks source link

response undefined in `.on('upload-error', (file, error, response) => ...)` #5439

Open angelaman opened 3 weeks ago

angelaman commented 3 weeks ago

Initial checklist

Link to runnable example

https://stackblitz.com/edit/vitejs-vite-mrjtcx?file=main.js

Steps to reproduce

  1. upload any file
  2. look in the console for message: "Uppy-Error ****

Expected behavior

In the setup, I added callback on upload error:

.on('upload-error', (file, error, response) => {
    console.log('Uppy-Error ********************', response);
  })

"Uppy-Error **** " should be followed with actual response from the http request

Actual behavior

"Uppy-Error **** undefined"

undefined is found instead of actual response

AxelWerner commented 6 days ago

Same issue here, I hope this can be fixed soon.

Murderlon commented 5 days ago

How did you actually reproduce this with a real setup? You leave your xhr endpoint empty, if no server exists it's not possible to ever receive a response. Uppy should probably check if endpoint is an empty string and throw and error early.