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

@uppy/xhr-upload: upload fails if server returns 204 empty #4963

Closed
2 tasks done
pzeinlinger opened this issue Feb 26, 2024 · 0 comments · Fixed by #4964
Closed
2 tasks done

@uppy/xhr-upload: upload fails if server returns 204 empty #4963

pzeinlinger opened this issue Feb 26, 2024 · 0 comments · Fixed by #4964
Assignees
Labels

Comments

@pzeinlinger
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

No response

Steps to reproduce

  1. init xhr plugin
uppy.use(XHR, {
      endpoint: xhrEndpoint,
      fieldName: "file",
      formData: true,
      limit: 5,
})
  1. upload file and return 204 from server

Expected behavior

Upload should succeed

Actual behavior

Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
    getResponseData index.js:68

Client behaves different from documented behaviour (https://uppy.io/docs/xhr-upload/#getresponsedata, default: (responseText, response) => void).
Change been introduced in #4892.
Issue is at:

return JSON.parse(responseText)

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

Successfully merging a pull request may close this issue.

2 participants