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] RangeError: Invalid array length

See original GitHub issue
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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tme321commented, Jul 12, 2017

Just adding my 2 cents in, having the same issue. A single file, if I remove the code from it everything else works and docs get generated. With this file it doesn’t work.

https://github.com/tme321/Unopinionated-Angular/blob/master/src/lib/dropdown-input/dropdown-input-item-list.component.ts

0reactions
lock[bot]commented, Oct 1, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: invalid array length - Stack Overflow
This error occurs because of the selection of wrong name that's why it says Invalid array length. Share.
Read more >
JavaScript RangeError: Invalid Array Length - Airbrake Blog
As mentioned above, Invalid Array Length errors occur when JavaScript code attempts to generate an Array or ArrayBuffer object where the first ...
Read more >
JavaScript RangeError - Invalid array length - GeeksforGeeks
Cause of the error: The length of an Array or an ArrayBuffer can only be represented by an unsigned 32-bit integer, which only...
Read more >
RangeError: invalid array length - JavaScript
The JavaScript exception "Invalid array length" occurs when creating an Array or an ArrayBuffer which has a length which is either negative or...
Read more >
Bug: "RangeError: Invalid typed array length: 5242880000 ...
The JavaScript exception "Invalid array length" occurs when creating an Array or an ArrayBuffer which has a length which is either negative or ......
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