sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
MIT License
11.83k stars 341 forks source link

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'headers') #574

Open EgorEast opened 2 months ago

EgorEast commented 2 months ago

I am sending the file to the s3 service, but an error occurs with the status 201, but with the response "User not found".

Headers: image

Preview: image

The problem is that with such an error, the library issues its own untraceable error image What is indicated in sources image

Sometimes indicates that credentials are not specified

sigmachirality commented 2 months ago

+1, also getting this error atm

Screenshot 2024-04-17 at 1 34 20 PM

Trace stack points to the same line

Screenshot 2024-04-17 at 1 35 06 PM

Was able to get the original error by rewriting the request in fetch, but ideally the error would propagate correctly/wouldn't get eaten by this line

Screenshot 2024-04-17 at 1 45 06 PM

Curious to see how this'll get resolved

sholladay commented 1 week ago

The error indicates that you are passing undefined as the first argument to Ky.

Could you please show your code that causes the error?