TS Build Error: TS5084: Tuple members must all have names or all not have names
I got this error after trying to build my project with Redis as a dependency:
$ tsc
node_modules/@redis/client/dist/lib/commands/generic-transformers.d.ts:196:67 - error TS5084: Tuple members must all have names or all not have names.
196 type StreamMessagesRawReply = TuplesReply<[name: BlobStringReply, ArrayReply<StreamMessageRawReply>]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in node_modules/@redis/client/dist/lib/commands/generic-transformers.d.ts:196
error Command failed with exit code 2.
From looking at the source code, it looks like the ArrayReply part of the tuple should have a name of messages?
https://github.com/redis/node-redis/blob/6f3380ba68786a3d5a9825f9a29c2053e43d32e3/packages/client/lib/commands/generic-transformers.ts#L553
Hey @joshowens-basis,
Thank you for reporting this issue. I've successfully reproduced it with node-redis 5.5.6 and typescript 4.9.5. As a temporary workaround, can you check if setting skipLibCheck: true in your tsconfig.json resolves the issue for you?
Since you've already identified where this issue occurs, would you be interested in submitting a PR to fix it?
Isn't the solution to use/require TypeScript 5.2+ https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#named-and-anonymous-tuple-elements