Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Type definition issue #250

Closed
grokasm opened this issue Nov 25, 2020 · 2 comments · Fixed by #251
Closed

Multi Type definition issue #250

grokasm opened this issue Nov 25, 2020 · 2 comments · Fixed by #251

Comments

@grokasm
Copy link

grokasm commented Nov 25, 2020

My app currently uses Typescript version 3.8.2 and I'm encountering the following error when building with tsc

node_modules/handy-redis/dist/node_redis/multi.d.ts:3:50 - error TS1256: A rest element must be last in a tuple type.

3 declare type Push_ts4<A extends unknown[], B> = [...A, B];

The README states the multi command has a fallback for Typescript < 4, but it doesn't seem to build at all.

I'm not able to upgrade to ts > 4 at this time. Are there any known workarounds?
Thanks!

@mmkal
Copy link
Owner

mmkal commented Nov 25, 2020

Thanks for the report @grokasm - I forgot that ts-ignore statements are stripped when generating declarations. If you manually add // @ts-ignore to the line above in node_modules/handy-redis/dist/node_redis/multi.d.ts, does the problem go away?

If that works, I can explicitly patch the d.ts file before publishing a new version (shouldn't take long, but you can use patch-package if you need to work right now). For the long term, I've asked about a better way to do this in the typescript issue above.

@grokasm
Copy link
Author

grokasm commented Nov 30, 2020

Thanks @mmkal for the workaround, I have since moved to the redis module out of necessity. In the meantime we are upgrading to typescript > 4, so I will most likely return to this very useful redis library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants