To reproduce, construct a session (either ws or http) without passing a stub into the generic arg.
For http, simply constructing the session is enough to get the error.
import { newHttpBatchRpcSession } from "capnweb";
const http = newHttpBatchRpcSession("...");
For ws, the error occurs when attempting to call a method:
import { newWebSocketRpcSession } from "capnweb";
const api = newWebSocketRpcSession("...")
api.ping();
Expected behaviour:
I'd expect for it to return something like Stub<unknown> and then error with when accessing any methods. Essentially I should get an untyped stub that I can pass around.