Skip to content

"Type instantiation is excessively deep and possibly infinite" when calling a method on an untyped session #53

@tom-sherman

Description

@tom-sherman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions