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] Error when Component Metadata was imported. #94

Closed
minhoryang opened this issue Jan 26, 2017 · 8 comments
Closed

[BUG] Error when Component Metadata was imported. #94

minhoryang opened this issue Jan 26, 2017 · 8 comments

Comments

@minhoryang
Copy link

Overview of the issue

RangeError: Invalid array length

@Component(MyAgClickableParentComponentSchema)
export class AppUserDeleteClickableComponent extends MyAgClickableParentComponent {}
export const MyAgClickableParentComponentSchema = {
    template: `
        <button (click)="clicked()">{{ name }}</button>
    `,
};
Operating System, Node.js, npm, compodoc version(s)

Node.js v6.9.1
npm 4.0.2
compodoc 0.0.37

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

https://gist.github.com/minhoryang/942c6c8bd4e0507e296d417c80dda00f

Compodoc installed globally or locally ?

locally

npm install compodoc
Motivation for or Use Case
./node_modules/.bin/compodoc -p src/tsconfig.json
Reproduce the error

https://gist.github.com/minhoryang/942c6c8bd4e0507e296d417c80dda00f
includes

  • compodoc.log
  • related .ts files when RangeError: Invalid array length happened
Related issues

#11

Suggest a Fix
@vogloblinsky
Copy link
Contributor

vogloblinsky commented Jan 26, 2017

Ok reproduced.

The MyAgClickableParentComponentSchema break the parsing. Will try to resolve that asap.

@AilisObrian
Copy link

var properties = decorator.expression.arguments[0].properties;

Normally decorator.expression.arguments[0] was an instance of NodeObject, but in this case IdentifierObject.

@AilisObrian
Copy link

It called by

directiveInfo = this.visitDirectiveDecorator(classDeclaration.decorators[i]);

directiveInfo = this.visitDirectiveDecorator(classDeclaration.decorators[i]);

But I couldn't find the usage of directiveInfo.
Is there any hint of this?

@AilisObrian
Copy link

Is it possible to get the not-yet parsed variable (MyAgClickableParentComponentSchema) from this.visitDirectiveDecorator()?

@vogloblinsky
Copy link
Contributor

@AilisObrian not yet done the test, may be.

@shaharkazaz
Copy link

I also get the same error when running compodoc

@chat-du-cheshire
Copy link

chat-du-cheshire commented Jul 26, 2017

Hi, this also happens when you try to extend your decorator with spread (...) operator.

For example:

base.ts

import { trigger, state, transition, animate, style } from "@angular/animations";

export const DECORATIONS_BASE = {
     styles:[':host{position:static;display:block;height: auto; width: auto;}'],
     animations: [
        trigger('shownChanged', [
        state("SHOWN_STATE", style({ opacity: 1 })), 
        state("HIDDEN_STATE", style({ opacity: 0 })),
        transition('* => *', animate('.2s'))
        ])
    ]
};

comp.component.ts

import { Component, OnInit } from '@angular/core';
import {DECORATIONS_BASE} from './base';


@Component({
  selector: 'my-comp',
  templateUrl: './comp.component.html',
  styleUrls: [ './comp.component.css' ],
  ...DECORATIONS_BASE
})
// export class YourComponentClassName

Hope it's possible to fix.

Thank you!

@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

5 participants