Skip to content

Hono RPCHandler Abnormal Behaviour #515

Description

@JustinApt

Hi, I am trying to learn oRPC and integrate it with my Hono (Node.js) backend, following this piece of documentation.

The issue I'm running into is that for some reason, the RPCHandler imported from @orpc/server/fetch is unable to send requests properly from Hono to my oRPC procedure.

The Zod validator (expecting a json object) on the side of oRPC will only receive an undefined input and responds with an "Input validation failed" 400 error.

Interestingly, when I went for another approach and set up a server client that consumes the request directly with an app.post() inside Hono, the procedure and Zod validation went through successfully.

Here's the code that aims to reproduce this issue, including the server client method that I've just mentioned (commented out).

Have I misunderstood some basic concepts on how oRPC works? Hopefully someone more experienced or @unnoq can provide some insights that nudge me in the right direction.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions