Skip to content

Type Error: cannot read property of undefined #195

@dylanirlbeck

Description

@dylanirlbeck

I'm getting an issue where I installed react-docgen-typescript with yarn and attempt to call it like such

const tsParser = require("react-docgen-typescript");
// Some code
var propTypes = tsParser.parse("./componentToParse.tsx");
console.log(propTypes[0].props);

and end up getting this error

TypeError: Cannot read property 'props' of undefined

Has anyone seen this before and do you have any ideas what could be happening? The weird thing is, if I operate within a fork of the react-docgen-typescript repo I'm totally fine. It only seems to be failing when I try and install it as a dependency in another project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThere is no activity for a long time.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions