react-docgen-typescript icon indicating copy to clipboard operation
react-docgen-typescript copied to clipboard

Cannot read property 'parameters' of undefined

Open trashhalo opened this issue 3 years ago • 2 comments

The type on this function assumes the param callSignature can never be undefined. https://github.com/styleguidist/react-docgen-typescript/blob/f8556be6beeafb95d0afec4be27daebd12a24626/src/parser.ts#L526-L527

But you can see in the implementation of getCallSignature its grabbing the 0th index out of this array. If the array is empty it will be undefined. https://github.com/styleguidist/react-docgen-typescript/blob/f8556be6beeafb95d0afec4be27daebd12a24626/src/parser.ts#L552-L559

On [email protected] [email protected] its bombing out:

70% sealing React Docgen Typescript Plugin/Users/stephensolka/dev/angellist/frontend/talent/node_modules/react-docgen-typescript/lib/parser.js:328
        return callSignature.parameters.map(function (param) {
                             ^

TypeError: Cannot read property 'parameters' of undefined
    at Parser.getParameterInfo (/Users/stephensolka/dev/angellist/frontend/talent/node_modules/react-docgen-typescript/lib/parser.js:328:30)

trashhalo avatar Jul 16 '21 20:07 trashhalo

I'm getting the same error. Trying to understand where/how I've introduced this.

ghost avatar Sep 16 '21 23:09 ghost

Hello, maybe you can ask here:

https://stackoverflow.com/questions/53675139/cannot-read-property-parameters-of-undefined-while-passing-context-actions-o

rtek1000 avatar Jan 18 '22 04:01 rtek1000

There was no activity for a long time. The issue will be closed soon.

github-actions[bot] avatar Jan 18 '23 10:01 github-actions[bot]

any updates?

val1991 avatar Jan 24 '23 20:01 val1991

There was no activity for a long time. The issue will be closed soon.

github-actions[bot] avatar Jan 26 '24 10:01 github-actions[bot]

Closing this issue as obsolete.

github-actions[bot] avatar Feb 02 '24 10:02 github-actions[bot]