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

TypeError when constructing a 204 Response from UploadFile#upload #809

Closed
opposable-crumbs opened this issue Jun 21, 2022 · 2 comments
Closed
Labels

Comments

@opposable-crumbs
Copy link

opposable-crumbs commented Jun 21, 2022

On versions >= 6.0.0 (#770 as far as I can tell) I'm receiving the following error as a response to a file.upload(...) call.

http-request.js:25 Uncaught TypeError: Failed to construct 'Response': Response with null body status cannot have body

I'm uploading said file to S3, and the reponse from AWS is a 204. However, when constructing the Response on this line, request.response evaluates to an empty string. Response expects either null or undefined as the first parameter when the response status is 204, hence the TypeError.

I'm not sure if the empty string is coming from AWS or simply the XMLHttpRequest#response method. It also seems like an issue that would have affected a lot of people already, so if I'm just missing something really obvious please let me know. I'm not doing anything special with the S3 upload, but I can provide a sample request if that is helpful.

This is exhibited on

  • Chrome - Version 102.0.5005.115 (Build officiel) (arm64)
  • Firefox - 101.0.1 (64-bit)
  • Safari - Version 15.5 (17613.2.7.1.8)

using Ember Source 3.28

@gilest gilest added the bug label Jun 25, 2022
gilest added a commit that referenced this issue Jun 25, 2022
Reported in #809

Reproduced and patched through a regression test.
@gilest
Copy link
Collaborator

gilest commented Jun 25, 2022

Thanks for reporting! This is hopefully fixed in 7.0.1

@gilest gilest closed this as completed Jun 25, 2022
@opposable-crumbs
Copy link
Author

I bumped to 7.0.2 today and everything is working. Thanks for such a quick turnaround!

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

2 participants