Some methods on my stub are being
Some methods on my stub are being returned as
never
. Anyone had this before?9 Replies
This returns never

But, there's indeed a promise. Even when I return a simple promise with as a string, it still sthows
never
.
However a little higher up i'm calling the same stub with a simliar function and it has a promise? wtf

These are simliar functions

Hmm i think it has to do with the complexity of the type and the inference of the stub (
DurableObjectNamespace<AIChatDurableObject>
)

Right! Even returning them like this doesn't make any difference 😦


I only found this on Github so far
https://github.com/cloudflare/workerd/issues/3063
GitHub
"Type instantiation is excessively deep and possibly infinite", uni...
In a worker, I commonly use a pattern of calling durable objects from an API worker - when the DOs respond, they either contain a response type (e.g. a serializable object) or a Response type. I us...
Found another thread;
https://github.com/cloudflare/workerd/issues/2003
GitHub
rpc can only return
type
not interface
/class
· Issue #2003 · ...Repro When calling a DO RPC method, return type collapses to Promise/never if using an interface. When using a type, return values are as expected.