Assistance with registering commands and typescript

Hello, I was following the guide in the documentation and reached this point:
client.commands = new Collection();


I've tried creating a seperate file (discord.d.ts)
import type {Collection, Command} from 'discord.js';

declare module 'discord.js' {
  export interface Client {
    commands: Collection<unknown, Command>;
  }
}

with the following tsconfig.json
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "commonjs",
    "rootDir": "./src/",
    "outDir": "./dist/",
    "strict": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "allowSyntheticDefaultImports": true,
    "resolveJsonModule": true,
    "forceConsistentCasingInFileNames": true,
    "removeComments": true,
    "typeRoots": ["node_modules/@types", "src/@types"],
    "sourceMap": false,
    "baseUrl": "./"
  },
  "files": ["src/Bot.ts"],
  "include": ["./**/*.ts"],
  "exclude": ["node_modules", "dist"]
}


However I run into the following error that the property still doesn't exist:
error TS2339: Property 'commands' does not exist on type 'Client<boolean>'.
Was this page helpful?