Skip to content

[BUG] RangeError: Invalid array length #209

@Robouste

Description

@Robouste
Overview of the issue

Error while generating the doc :
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RangeError: Invalid array length

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

Windows 7
Node 6.10.2
Npm 3.10.10
compodoc 1.0.0-beta.10
angular-cli 1.0.6

Angular configuration, a package.json file in the root folder
{
  "name": "angular-cli-seed",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": ".\\node_modules\\.bin\\ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/material": "^2.0.0-beta.6",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.6.0",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jquery": "^2.2.1",
    "morris.js": "^0.5.0",
    "ng2-charts": "^1.6.0",
    "ng2-drag-drop": "^2.0.1",
    "ngx-pipes": "^1.6.1",
    "rxjs": "^5.1.0",
    "web-animations-js": "^2.2.5",
    "webpack-raphael": "^2.1.4",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.0.6",
    "@angular/compiler-cli": "^4.0.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.2.0"
  }
}
Compodoc installed globally or locally ?

globally

Motivation for or Use Case

I would like to generate the doc

Reproduce the error

Command line used :
compodoc -p .\src\tsconfig.app.json

Here is the component for which it fails. If I remove all the class content, the doc is generated successfully:

import { Component, Input, OnDestroy  } from "@angular/core";

@Component({
    selector: "loading-helper",
    templateUrl: "loading-helper.component.html",
    styleUrls: ["loading-helper.component.scss"]
}) 
export class LoadingHelperComponent implements OnDestroy  {

    public visible: boolean = true;
    public timeout: any;

    /**
    * @description : if needed, we can wait before showing the spinner
    **/
    @Input() delay: number = 0;

    /**
    * @description : The text above the spinner ("loading", "no results", etc)
    **/
    @Input() feedback: string;

    @Input() public set isRunning(value: boolean) {
        if (!value) {
            this.cancel();
            this.visible = false;
            return;
        }

        if (this.timeout) {
            return;
        }

        this.timeout = setTimeout(() => {
            this.visible = true;
            this.cancel();
        }, this.delay);
        
    }

    private cancel(): void {
        clearTimeout(this.timeout);
        this.timeout = undefined;
    }

    ngOnDestroy(): void {
        this.cancel();
    }
}
Related issues

#103 #169

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions