Search
Get Started
CD
Cloudflare Developers
•
12mo ago
Chris Jayden
Some methods on my stub are being
Some methods on my stub are being returned as
never
never
. Anyone had this before
?
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
83,043
Members
View on Discord
Was this page helpful?
Yes
No
C
Chris Jayden
OP
•
1/15/25, 5:24 PM
This returns never
C
Chris Jayden
OP
•
1/15/25, 5:25 PM
But
, there
's indeed a promise
. Even when I return a simple promise with as a string
, it still sthows
never
never
.
C
Chris Jayden
OP
•
1/15/25, 5:26 PM
However a little higher up i
'm calling the same stub with a simliar function and it has a promise
? wtf
C
Chris Jayden
OP
•
1/15/25, 5:27 PM
These are simliar functions
C
Chris Jayden
OP
•
1/15/25, 5:28 PM
Hmm i think it has to do with the complexity of the type and the inference of the stub
(
)
C
Chris Jayden
OP
•
1/15/25, 5:28 PM
Original message was deleted
C
Chris Jayden
OP
•
1/16/25, 8:20 AM
Right
! Even returning them like this doesn
't make any difference
C
Chris Jayden
OP
•
1/16/25, 8:20 AM
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
.
.
.
C
Chris Jayden
OP
•
1/16/25, 8:34 AM
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
.
DurableObjectNamespace<AIChatDurableObject>
DurableObjectNamespace<AIChatDurableObject>