Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <rejected> TypeError: Cannot read property 'concat' of undefined #542

Closed
codeNoobie opened this issue Apr 15, 2018 · 5 comments
Closed

Comments

@codeNoobie
Copy link

codeNoobie commented Apr 15, 2018

[BUG]

Overview of the issue

I am getting this error while generating docs. Not sure what is causing this. Any help is greatly appreciated.

Unhandled Rejection at: Promise {
TypeError: Cannot read property 'concat' of undefined
at Path/node_modules/@compodoc/compodoc/dist/index-cli.js:3533:71
at Array.forEach ()
at ExtendsMerger.merge (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:3513:25)
at Dependencies.getDependencies (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:5487:35)
at CliApplication.Application.getDependenciesData (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:7079:40)
at Path/node_modules/@compodoc/compodoc/dist/index-cli.js:6924:23
at } reason: TypeError: Cannot read property 'concat' of undefined
at Path/node_modules/@compodoc/compodoc/dist/index-cli.js:3533:71
at Array.forEach ()
at ExtendsMerger.merge (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:3513:25)
at Dependencies.getDependencies (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:5487:35)
at CliApplication.Application.getDependenciesData (Path/node_modules/@compodoc/compodoc/dist/index-cli.js:7079:40)
at Path/node_modules/@compodoc/compodoc/dist/index-cli.js:6924:23
at
[13:13:39] 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)

Operating System, Node.js, npm, compodoc version(s)

node -v
v9.8.0

npm -v
5.6.0

compodoc -V
1.1.2

macOS High Sierra

Angular configuration, a package.json file in the root folder

I am using Yarn workspaces. The compodoc works well with one of the workspace. But it fails for another.

Angular-cli.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "core-project"
  },
  "packageManager": "yarn",
  "apps": [{
    "name": "distro",
    "root": "src",
    "outDir": "dist",
    "assets": [
        "assets",
        "favicon.ico"
    ],
    "index": "index.html",
    "main": "main.ts",
    "polyfills": "polyfills.ts",
    "test": "test.ts",
    "tsconfig": "tsconfig.distro.json",
    "testTsconfig": "tsconfig.spec.json",
    "prefix": "core-project",
    "styles": [],
    "scripts": []
  }],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [{
      "project": "src/tsconfig.distro.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    }
  ],
  "test": {
    "karma": {
      "config": "./src/test-config/karma.prod.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "component": {}
  }
}
Package.json
{
    "name": "core-project",
    "version": "0.0.0",
    "private": false,
    "scripts": {
        "compodoc": "./node_modules/.bin/compodoc -p src/tsconfig.distro.json"
    },
    "ngPackage": {
        "$schema": "node_modules/ng-packagr/ng-package.schema.json",
        "dest": "dist",
        "workingDirectory": ".ng_build",
        "lib": {
            "entryFile": "src/public_api.ts",
            "cssUrl": "inline"
        }
    },
    "peerDependencies": {
        "@angular/common": "~5.2.0",
        "@angular/core": "~5.2.0",
        "@angular/platform-browser": "~5.2.0",
        "@angular/platform-browser-dynamic": "~5.2.0",
        "@appd/common": "~1.0.4-92",
        "core-js": "~2.4.1",
        "lodash": "4.17.4",
        "rxjs": "~5.5.2",
        "zone.js": "~0.8.20"
    },
    "devDependencies": {
        "@angular/cli": "~1.6.0",
        "@appd/common": "~1.0.4-92",
        "@appd/test": "1.0.4-94",
        "@compodoc/compodoc": "^1.1.2",
        "karma": "^2.0.0",
        "karma-cli": "~1.0.1"
    }
}

tsconfig.distro.json

{
  "extends": "../../../tsconfig-base.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": [],
    "experimentalDecorators": true
  },
  "angularCompilerOptions": {
    "preserveWhitespaces": false
  },
  "include": [
    "**/*.ts"
  ],
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}
Compodoc installed globally or locally ?

Locally.

Motivation for or Use Case

Generating documentation for packages in my mono repo. Please note that compodoc works for one package but fails for another with the above exception.

It did not generate the documentation.

Reproduce the error

It failed when i ran ./node_modules/.bin/compodoc -p src/tsconfig.distro.json

Related issues
Suggest a Fix
@vogloblinsky vogloblinsky changed the title <rejected> TypeError: Cannot read property 'concat' of undefined [BUG] <rejected> TypeError: Cannot read property 'concat' of undefined Apr 16, 2018
@vogloblinsky vogloblinsky added this to the 1.1.3 milestone Apr 16, 2018
@vogloblinsky
Copy link
Contributor

vogloblinsky commented Apr 22, 2018

@codeNoobie Fixed by enforcing extends-merger.util
If you have an example of your code with a component extending somthing, or a class extending anothe rthing, it could be nice to add more unit testing on this.

@codeNoobie
Copy link
Author

@vogloblinsky We do have cases where component extends from an abstract class. Was that the reason behind this bug?

@vogloblinsky
Copy link
Contributor

@codeNoobie.
It could. Could you extract an example for debugging and testing enforcement ?
Thanks

@codeNoobie
Copy link
Author

Sure. Will do it by tomorrow.

@lock
Copy link

lock bot commented Sep 30, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants