bug: Type inference not working for streams
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 40.6k
- Forks
- 1.7k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 22
Description
Provide environment information
https://trpc.io/?try=minimal#try-it-out
Describe the bug
https://trpc.io/?try=minimal#try-it-out
Even in the minimal example, type inference is not working for output of async generators.
In the documentation for HTTP Batch Stream Link, it seems like type inference for async generators should still work
Link to reproduction
https://trpc.io/?try=minimal#try-it-out
To reproduce
open up https://trpc.io/?try=minimal#try-it-out
hover over the type on the output of examples.iterable
notice it is any type
Additional information
No response
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR fixing this bug!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproduction at https://trpc.io/?try=minimal#try-it-out and inspect the output type of examples.iterable, which currently appears as any. Compare this behavior with the HTTP Batch Stream Link documentation and async-generator example; done means the stream output has the expected inferred type rather than any.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100