Cannot read property 'kind' of undefined

I’ve been battling with this issue for 2 days. Finally fixed it and decided to help others whose source of issue might be similar to mine.

If you have a TS project, ensure your tsconfig.json is properly configured. Especially the include array. I tinkered with mine and didn’t realise I bricked Strapi.

{
  "extends": "@strapi/typescript-utils/tsconfigs/server",
  "compilerOptions": {
    "outDir": "dist",
    "rootDir": ".",
    "skipLibCheck": true,
    "resolveJsonModule": true
  },
  "include": ["./", "./**/*.ts", "./**/*.js", "src/**/*.json"],
  "exclude": [
    "node_modules/**",
    "build/**",
    "dist/**",
    ".cache/",
    ".tmp/",
    "src/admin/",
    "**/*.test.*",
    "src/plugins/**",
    "node_modules/**/*.d.ts"
  ]
}