Skip to content

RPC hanging request with RpcServer.toHttpApp(MinimalPingRpc).pipe(Effect.map(HttpApp.toWebHandler)) #4990

Description

@Industrial

What version of Effect is running?

3.16.3

What steps can reproduce the bug?

git clone https://github.com/Industrial/test-effect-rpc.git
cd test-effect-rpc
npm i
npm run dev

client:

npx tsx src/rpc/client.ts

What is the expected behavior?

For the request to be processed and end correctly and the program to exit.

What do you see instead?

The request hangs indefinitely

Additional information

It works with an Effect.ts powered HTTP server along the lines of:

export const RpcLayer = RpcServer.layer(MinimalPingRpc).pipe(
  Layer.provide(MinimalPingLive),
)
export const RpcHttpProtocolLayer = RpcServer.layerProtocolHttp({
  path: '/api/rpc',
}).pipe(Layer.provide(RpcSerialization.layerJson))

const Main = HttpRouter.Default.serve().pipe(
  Layer.provide(RpcLayer),
  Layer.provide(RpcHttpProtocolLayer),
  Layer.provide(BunHttpServer.layer({ port: 3000 })),
)
BunRuntime.runMain(Layer.launch(Main))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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