tRPCttRPC
Powered by
h3lloH
tRPC•14mo ago•
2 replies
h3llo

subscription tracked returns a 3-tuple to frontend instead of object

I am using
tracked
tracked
as per recommendation in https://trpc.io/docs/server/subscriptions#tracked like this:
for await (const [eventData] of iterable) {
    yield tracked(eventData.jobId, eventData);
  }
for await (const [eventData] of iterable) {
    yield tracked(eventData.jobId, eventData);
  }


It's properly typed on both frontend and backend, eg:
{
    id: string;
    data: someObject;
}
{
    id: string;
    data: someObject;
}


however what I actually receive on frontend is an 3-tuple [id, data, null].

I tried this both on versions
"11.0.0-rc.666"
"11.0.0-rc.666"
and
next
next
and got the same results.
Subscriptions | tRPC
Introduction
Subscriptions | tRPC
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Middleware that returns data instead of throwing error
valtyrVvaltyr / ❓-help
3y ago
subscription
Ahmed EidAAhmed Eid / ❓-help
4y ago