Some methods on my stub are being

Some methods on my stub are being returned as never. Anyone had this before?
9 Replies
Chris Jayden
Chris JaydenOP•6d ago
This returns never
No description
Chris Jayden
Chris JaydenOP•6d ago
But, there's indeed a promise. Even when I return a simple promise with as a string, it still sthows never.
No description
Chris Jayden
Chris JaydenOP•6d ago
However a little higher up i'm calling the same stub with a simliar function and it has a promise? wtf
No description
Chris Jayden
Chris JaydenOP•6d ago
These are simliar functions
No description
Chris Jayden
Chris JaydenOP•6d ago
Hmm i think it has to do with the complexity of the type and the inference of the stub (DurableObjectNamespace<AIChatDurableObject>)
No description
Chris Jayden
Chris JaydenOP•6d ago
No description
Chris Jayden
Chris JaydenOP•5d ago
Right! Even returning them like this doesn't make any difference 😦
No description
No description
Chris Jayden
Chris JaydenOP•5d ago
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...
Chris Jayden
Chris JaydenOP•5d ago
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.

Did you find this page helpful?