Typescript build failure

Hello, using Typescript 5.1.6 and a one-liner index.ts that imports (version 14.12.1) discord.js, I get two compiler errors from the typings of the library:
node_modules/discord.js/typings/index.d.ts:3852:14 - error TS2536: Type 'T' cannot be used to index type 'MappedChannelCategoryTypes'.

3852 ): Promise<MappedChannelCategoryTypes[T]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/discord.js/typings/index.d.ts:3899:14 - error TS2536: Type 'T' cannot be used to index type 'MappedGuildChannelTypes'.

3899 ): Promise<MappedGuildChannelTypes[T]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/discord.js/typings/index.d.ts:3852:14 - error TS2536: Type 'T' cannot be used to index type 'MappedChannelCategoryTypes'.

3852 ): Promise<MappedChannelCategoryTypes[T]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/discord.js/typings/index.d.ts:3899:14 - error TS2536: Type 'T' cannot be used to index type 'MappedGuildChannelTypes'.

3899 ): Promise<MappedGuildChannelTypes[T]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
version 14.11.0 had no similar problem. Is there something I should check about the environment? Is this a known problem?
2 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Nemokosch
NemokoschOP17mo ago
Node v18.7.0 on Ubuntu 20.04 in WSL2, for the record
Want results from more Discord servers?
Add your server