You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: The SDK's client.gen.ts only handles empty responses when status === 204 or Content-Length === "0". When the server returns an empty body with status 200 and no Content-Length header, response.json() throws "Unexpected end of JSON input".
Fix:
Read response as text first, only parse JSON if non-empty
Added try-catch with contextual error messages
Fixed server OPTIONS handler to return proper 204 status
This is a more complete fix than #7618 - it prevents the crash entirely rather than just improving the error message.
Activity
github-actions commentedon Jan 10, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
coleleavitt commentedon Jan 12, 2026
I've submitted a fix for this in #7888.
Root cause: The SDK's
client.gen.tsonly handles empty responses whenstatus === 204orContent-Length === "0". When the server returns an empty body with status 200 and no Content-Length header,response.json()throws "Unexpected end of JSON input".Fix:
This is a more complete fix than #7618 - it prevents the crash entirely rather than just improving the error message.
mrlubos commentedon Jan 13, 2026
@Davincible this should be handled upstream hey-api/hey-api#3202
chore(sdk): update @hey-api/openapi-ts to 0.90.4