Skip to content

[styled-components] Type instantiation is excessively deep and possibly infinite #42829

@thany

Description

@thany

After upgrading to styled-components 5.0.1 from 4.1.9, we're getting these errors.

TS2589: Type instantiation is excessively deep and possibly infinite.

Here's a playground link that DOESN'T show the error, but this error in an actual project will definitely show. In our case, in many multiple files. Everything was fine before the update.

The error shows on text={text} {...rest} role="separator" and disappears when removing {...rest}.

All is well if I don't upgrade this package, even when I do upgrade styled-components itself.

It might help to know as well that we're on Typescript 3.8.3. Perhaps a newer typescript is stricter in some magical way, although I seriously doubt they'd introduce such impressively strange breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions