question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot read property kind of undefined

See original GitHub issue
Compodoc fails to generate docs

[19:34:27] Searching package.json file [19:34:27] package.json file found [19:34:27] Processing package.json dependencies [19:34:27] Searching README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE.md, TODO.md files [19:34:27] README.md file found [19:34:27] Error during /home/myproject/CHANGELOG read [19:34:27] Continuing without CHANGELOG.md file [19:34:27] Error during /home/myproject/CONTRIBUTING read [19:34:27] Continuing without CONTRIBUTING.md file [19:34:27] Error during /home/myproject/LICENSE read [19:34:27] Continuing without LICENSE.md file [19:34:27] Error during /home/myproject/TODO read [19:34:27] Continuing without TODO.md file [19:34:27] Get dependencies data Unhandled Rejection at: Promise { <rejected> TypeError: Cannot read property ‘kind’ of undefined at isObjectOrObjectArrayTypeReference (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20709:34) at parseNestedTypeLiteral (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20748:43) at parseParameterOrPropertyTag (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20733:85) at parseTag (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20572:40) at /home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20447:44 at Object.scanRange (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:8611:26) at parseJSDocCommentWorker (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20419:25) at Object.parseJSDocComment (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20373:31) at addJSDocComment (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:15579:68) at createNodeWithJSDoc (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:15906:17) } reason: TypeError: Cannot read property ‘kind’ of undefined at isObjectOrObjectArrayTypeReference (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20709:34) at parseNestedTypeLiteral (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20748:43) at parseParameterOrPropertyTag (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20733:85) at parseTag (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20572:40) at /home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20447:44 at Object.scanRange (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:8611:26) at parseJSDocCommentWorker (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20419:25) at Object.parseJSDocComment (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:20373:31) at addJSDocComment (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:15579:68) at createNodeWithJSDoc (/home/myproject/node_modules/ts-simple-ast/node_modules/typescript/lib/typescript.js:15906:17) [19:34:30] Sorry, but there was a problem during parsing or generation of the documentation. Please fill an issue on github. (https://github.com/compodoc/compodoc/issues/new)

kubuntu 19.10, node v12.13.1, compodoc 1.1.11
compodoc is installed in dev depenencies and ran thru npx
just ran npx compodoc -p tsconfig.json -d docs/

  "name": "my-project",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "docs": "npx compodoc -p tsconfig.json -d docs/"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.2.7",
    "@angular/common": "~8.2.7",
    "@angular/compiler": "~8.2.7",
    "@angular/core": "~8.2.7",
    "@angular/forms": "~8.2.7",
    "@angular/platform-browser": "~8.2.7",
    "@angular/platform-browser-dynamic": "~8.2.7",
    "@angular/router": "~8.2.7",
    "@feathersjs/authentication": "^4.5.1",
    "@feathersjs/authentication-client": "^4.5.1",
    "@feathersjs/feathers": "^4.5.1",
    "@feathersjs/socketio-client": "^4.5.1",
    "@feathersjs/transport-commons": "^4.5.1",
    "@swimlane/ngx-datatable": "^16.0.3",
    "@types/lodash": "^4.14.149",
    "angular2-hotkeys": "^2.1.5",
    "echarts": "^4.6.0",
    "feathers-reactive": "^0.8.1",
    "moment": "^2.24.0",
    "ng-zorro-antd": "^8.5.2",
    "ngx-echarts": "^4.2.2",
    "ngx-matomo": "^0.1.4",
    "rxjs": "~6.4.0",
    "tg-brainz": "file:../tg-brainz",
    "tslib": "^1.11.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.25",
    "@angular/cli": "^8.3.25",
    "@angular/compiler-cli": "~8.2.7",
    "@angular/language-service": "~8.2.7",
    "@compodoc/compodoc": "^1.1.11",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.2.1",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.5.2",
    "protractor": "^5.4.3",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "^3.8.2"
  }

Worked fine and seems it found everything in my project. Then crashed with this error and got the link to the bug report. 😄

Any other info I can help you with, please let me know. Cheers

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
nagashimamcommented, Nov 11, 2020

@dbvcode I know it’s too late, but removing the directory made by ng build fixed the issue for me.

0reactions
ajaykarwalcommented, Dec 14, 2022

I’ve been having this same issue and have fixed it. Hopefully this will help others with this issue.

Error occured in my app.module.ts file

found          : AppComponent
parsing        : C:/code/InsightMaker/InsightMaker.Apps/projects/insight-maker-search/app/app.module.ts
Unhandled Rejection at: Promise {
  <rejected> TypeError: Cannot read property 'kind' of undefined
      at Object.isShorthandPropertyAssignment (C:\code\InsightMaker\InsightMaker.Apps\node_modules\@ts-morph\common\dist\typescript.js:28621:21)
// ... etc

My app.module.ts file content was

import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { imports } from './imports';
import { providers } from './providers';
@NgModule({
	declarations: [AppComponent],
	imports,
	providers,
	bootstrap: [AppComponent]
})
export class AppModule { }

This was updated to not used the shorthand imports and providers properties, but declare them explicitly.

import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { imports } from './imports';
import { providers } from './providers';
@NgModule({
	declarations: [AppComponent],
	imports: imports,
	providers: providers,
	bootstrap: [AppComponent]
})
export class AppModule { }
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'kind' of undefined at ...
This is an issue related to the Angular devkit and build optimizer and has to do with version mismatches. I ran into this...
Read more >
TypeError: Cannot read property 'kind' of undefined · Issue ...
I have the problem with typescript 3.9.3 and next 9.4.2 and ts-node 8.10.1. Switching to typescript 3.8.3 fixes the problem.
Read more >
TypeError: Cannot read property 'kind' of undefined at ... - Dirask
I have got following error during my TypeScript project compilation into single file: I run my project with: tsconfig.prod.json file looks following way:...
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
Interpreting undefined or null as subtypes of all other types can lead to runtime problems. For example, if you try to get the...
Read more >
Error with webpack: TypeError: Cannot read property &#38;#03
I published a small project, so you can reproduce the problem: <a ... Error with webpack: TypeError: Cannot read property 'kind' of undefined....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found