Skip to content

fix: reject empty HTTP 200 RPC replies instead of resolving undefined - #5578

Merged
jxom merged 1 commit into
wevm:mainfrom
tydavid5:fix/empty-http-200-error
Nov 18, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
tydavid5:fix/empty-http-200-error

Conversation

@tydavid5

Copy link
Copy Markdown
Contributor

An HTTP 200 reply with an empty body used to resolve as a success with no result, so a call like sendRawTransaction looked like it worked while returning no transaction hash. The RPC client now checks that a reply for a single request is an object with a result or error, and throws otherwise, which surfaces as an HttpRequestError. The same check also covers a JSON body like {} or a bare value such as 123, while a null result still resolves normally.

I added a regression test with a real local server returning 200 with an empty body, and a changeset for a patch release.

Fixes #5570

An HTTP 200 reply with an empty body used to resolve as a success with no result, so a call like sendRawTransaction looked like it worked while returning no transaction hash. The RPC client now checks that a reply for a single request is an object with a result or error, and throws otherwise, which surfaces as an HttpRequestError. The same check also covers a JSON body like {} or a bare value such as 123, while a null result still resolves normally.

Fixes wevm#5570
@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@tydavid5 is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a00cd0f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxom
jxom merged commit be73ffa into wevm:main Nov 18, 2026
2 of 3 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http transport: an HTTP 200 reply with an empty body resolves the request with undefined

2 participants