fetch API TypeError on 204 response
Unanswered
Satin Angora posted this in #help-forum
Satin AngoraOP
I'm trying to upload a file to an S3 bucket inside a client component using fetch API to a presigned URL.
All of this happens inside a try/catch block and apparently when the fetch response returns a 204 No Content it is being caught as an exception rather than a successful response.
I am not sure whether this is a NextJS issue or something else, but I'd appreciate any help if it is, or if it is not maybe a clue to what it could be.
In any case the files are uploaded correctly and 204 is the expected response.
All of this happens inside a try/catch block and apparently when the fetch response returns a 204 No Content it is being caught as an exception rather than a successful response.
I am not sure whether this is a NextJS issue or something else, but I'd appreciate any help if it is, or if it is not maybe a clue to what it could be.
In any case the files are uploaded correctly and 204 is the expected response.