Typescript build failure

Hey guys can anyone help me with this error? Node v20.11.1 djs v14.14.1 TypeScript v5.4.2
node_modules/discord.js/typings/index.d.ts:3852:14 - error TS2536: Type 'T' cannot be used to index type 'MappedChannelCategoryTyp
es'.

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 'MappedChannelCategoryTyp
es'.

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]>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
3 Replies
d.js toolkit
d.js toolkit10mo 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! - Marked as resolved by OP
ShompiFlen
ShompiFlen10mo ago
what is your ts config do you have skipLibCheck: true?
syntxx_error
syntxx_errorOP10mo ago
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "ES2020",
"noImplicitAny": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*"
]
}
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "ES2020",
"noImplicitAny": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*"
]
}
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
nope, should i include it?
wait a sec 🤔 why the hack do i have 14.12.1 and i specified 14.14.1 🤔 sadge ok ill fix it ok, fixed, thanks for the help
Want results from more Discord servers?
Add your server