-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
"Unexpected end of JSON input" with bun.js #1486
Comments
openapi-fetch 0.8.2 |
Getting the same error with a bearer authorized request if that can help |
After investigating it seems the problem is from the clone before getting the json from the body (at least in my case), removing the cloning (and probably breaking other functionalities) works for me. |
Seems like this issue is known in the Bun repo oven-sh/bun#6969 (comment) (fix in oven-sh/bun#6468 but not yet merged) Maybe it could be considered to add a temporary fix here because fixing this type of bug doesn't seem to be a priority for bun maintainers. Also because it is a major bug making the library unusable with bun. |
I experienced this when using Bun. There is a pull request that should fix this and should be merged soon hopefully: A quick workaround meanwhile:
|
Ah glad to see they are fixing it! In the upcoming |
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem. |
Hey there, thanks for your work.
Looks like needed one more fix for bun (with node works good).
Description
If fetch with the ban, it looks like an object that has not yet been fully received is cloned.
Reproduction
error occur with using bun only.
client configuration:
The cloned response and the original are different, there is with some debug info before the error line:
in code:
in output:
And if we wait a little before cloning:
in code:
in output:
The text was updated successfully, but these errors were encountered: