Skip to content

self referencing flow type causing infinite loop #249

Closed
@SavePointSam

Description

@SavePointSam

While using react-styleguidist, I noticed that I was getting this warning:

Warning: Cannot parse src/components/Button/Button.js: RangeError: Maximum call stack size exceeded

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues

While trying to debug this problem. I was having issues determining where the issue came from. I am using Flow to type my components out and Flow wasn't reporting an error. However, I learned that the issue was coming from the fact that I had a type that defined a method that had a parameter that was the parent typing. While this works fine in Flow, it appears to cause issues when running through react-docgen.

Here is a slimmed down representation of the problem: Try Flow

Note: You may need to swap the engine to v0.64.0 or master as v0.65.0 is currently broken

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions