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 toolkit3mo 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
ShompiFlen3mo ago
what is your ts config do you have skipLibCheck: true?
syntxx_error
syntxx_error3mo 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?
+-- @types/cookie-parser@1.4.7
+-- @types/cors@2.8.17
+-- @types/express@4.17.21
+-- @types/jsonwebtoken@9.0.6
+-- @types/node@20.11.30
+-- axios@1.6.8
+-- cookie-parser@1.4.6
+-- cors@2.8.5
+-- csurf@1.11.0
+-- discord.js@14.12.1
+-- dotenv@16.4.5
+-- express@4.19.2
+-- jsonwebtoken@9.0.2
+-- node-fetch@3.3.2
+-- nodemon@3.1.0
+-- pg@8.11.3
+-- ts-node@10.9.2
+-- typeorm@0.3.20
`-- typescript@5.4.2
+-- @types/cookie-parser@1.4.7
+-- @types/cors@2.8.17
+-- @types/express@4.17.21
+-- @types/jsonwebtoken@9.0.6
+-- @types/node@20.11.30
+-- axios@1.6.8
+-- cookie-parser@1.4.6
+-- cors@2.8.5
+-- csurf@1.11.0
+-- discord.js@14.12.1
+-- dotenv@16.4.5
+-- express@4.19.2
+-- jsonwebtoken@9.0.2
+-- node-fetch@3.3.2
+-- nodemon@3.1.0
+-- pg@8.11.3
+-- ts-node@10.9.2
+-- typeorm@0.3.20
`-- typescript@5.4.2
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
More Posts