Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
angelaman opened this issue Aug 30, 2024 · 5 comments
Closed
2 tasks done
Labels

Comments

@angelaman
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

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

@angelaman angelaman added the Bug label Aug 30, 2024
@AxelWerner
Copy link

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

@Murderlon
Copy link
Member

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.

@chardin1
Copy link
Contributor

I'm having this issue too. Server sending a 400 status code with an error in the response body and I can't get to it.

@angelaman
Copy link
Author

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.

For simplicity to produce error, I left the endpoint as empty string. The main point is, when my server return error, I expect Uppy to forward the error response, instead returning undefined.

@Murderlon
Copy link
Member

Closed in #5486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants