Typing issues with discord.js

Having issues with the typings of discord.js on my TS project.
node_modules/discord.js/typings/index.d.ts:1231:3 - error TS1128: Declaration or statement expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~~~~~~

node_modules/discord.js/typings/index.d.ts:1231:28 - error TS1005: ',' expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~

node_modules/discord.js/typings/index.d.ts:1231:35 - error TS1005: ';' expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~

node_modules/discord.js/typings/index.d.ts:1232:3 - error TS1128: Declaration or statement expected.

1232 public getFocused(getFull?: boolean): string;
~~~~~~

node_modules/discord.js/typings/index.d.ts:1232:29 - error TS1109: Expression expected.

1232 public getFocused(getFull?: boolean): string;
~

node_modules/discord.js/typings/index.d.ts:1232:39 - error TS1005: ';' expected.

1232 public getFocused(getFull?: boolean): string;
~

node_modules/discord.js/typings/index.d.ts:1233:1 - error TS1128: Declaration or statement expected.

1233 }
~


Found 107 errors in the same file, starting at: node_modules/discord.js/typings/index.d.ts:1175
node_modules/discord.js/typings/index.d.ts:1231:3 - error TS1128: Declaration or statement expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~~~~~~

node_modules/discord.js/typings/index.d.ts:1231:28 - error TS1005: ',' expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~

node_modules/discord.js/typings/index.d.ts:1231:35 - error TS1005: ';' expected.

1231 public getFocused(getFull: true): AutocompleteFocusedOption;
~

node_modules/discord.js/typings/index.d.ts:1232:3 - error TS1128: Declaration or statement expected.

1232 public getFocused(getFull?: boolean): string;
~~~~~~

node_modules/discord.js/typings/index.d.ts:1232:29 - error TS1109: Expression expected.

1232 public getFocused(getFull?: boolean): string;
~

node_modules/discord.js/typings/index.d.ts:1232:39 - error TS1005: ';' expected.

1232 public getFocused(getFull?: boolean): string;
~

node_modules/discord.js/typings/index.d.ts:1233:1 - error TS1128: Declaration or statement expected.

1233 }
~


Found 107 errors in the same file, starting at: node_modules/discord.js/typings/index.d.ts:1175
There are way more errors not including full Here is my tsconfig.json:
{
"include": [
"./**/*.ts",
"./**/*.js",
"./.eslintrc.cjs",
],
"compilerOptions": {
"strict": false,
"moduleResolution": "node",
"module": "CommonJS",
"target": "ESNext",
"skipLibCheck": true,
"isolatedModules": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2021", "ESNext"],
"outDir": "./dist",
"esModuleInterop": true,
"incremental": true,
"noEmitHelpers": true,
"importHelpers": true,
"types": ["node"],
"allowJs": true,
"declaration": true,
"noImplicitAny": true,
}
}
{
"include": [
"./**/*.ts",
"./**/*.js",
"./.eslintrc.cjs",
],
"compilerOptions": {
"strict": false,
"moduleResolution": "node",
"module": "CommonJS",
"target": "ESNext",
"skipLibCheck": true,
"isolatedModules": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2021", "ESNext"],
"outDir": "./dist",
"esModuleInterop": true,
"incremental": true,
"noEmitHelpers": true,
"importHelpers": true,
"types": ["node"],
"allowJs": true,
"declaration": true,
"noImplicitAny": true,
}
}
I've used Discord.JS in the past and have never got this error, also searched for this errors in the forum and on slack and github but haven't found it.
4 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!
Artlfmj
Artlfmj10mo ago
discord.js@14.12.1 v20.5.1
treble/luna
treble/luna10mo ago
Update ts to 5.1
Artlfmj
Artlfmj10mo ago
worked fine, many thanks