Closed AnatolyRugalev closed 2 years ago
Hey @AnatolyRugalev do you have a repo I could take a look at? If not, could you let me know the version of TypeScript you're using, and could you paste your tsconfig.json here?
@tatethurston I have to admit that I have no idea what I'm doing when it comes to the TypeScript. I am essentially working on API itself and I need JS compatible client for our testing framework. I will certainly provide you with everything I can, but please forgive me for my ignorance.
This is the repo that I use for twirp generation: https://github.com/GetStream/stream-chat-js/tree/twirp-api
The repo is set up for ES5
target in tsconfig.json
, so I bumped it to ES2020
to fix other compilation errors. I also changed parser version in .eslintrc.json
to 2020
which, I assume, corresponds to ES2020
build target.
You can find all changes that I did to make it work with TwirpScript in this commit: https://github.com/GetStream/stream-chat-js/commit/e66385e471c92633427df79fa4e91cbbe0acd3d3
Thanks @AnatolyRugalev. I’ll take a look and see if I can recreate the type error. Off the top of my head, it could be very old @types/node but I’ll let you know what I find. In theory, if you’re just building a client and not using the server then @node/types should be unnecessary — I’ll check and if that is not the case I’ll update twirpscript.
As a design goal, I would like TwirpScript to “just work” with any starter tsconfig, no Typescript knowledge required. This will help me provide some guidance for minimal supported versions for typescript and node.
This has been resolved in v0.0.60. Thanks @AnatolyRugalev!
I'm getting this type error when building my package:
Declaration of this type looks like this:
I dropped last part
typeof Symbol.asyncIterator
and it fixed the problem for me.Thanks