New error: Type of property 'defaultProps' circularly references itself in mapped type
See original GitHub issuepackages/connected-components/src/header-editor/styled.ts:24:34 - error TS2615: Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof ReactDefaultizedProps<StyledComponentInnerComponent<WithC>, ComponentPropsWithRef<StyledComponentInnerComponent<WithC>>>, StyledComponentInnerAttrs<...> | ... 1 more ... | StyledComponentInnerAttrs<...>> | Exclude<...> | Exclude<...> | Exclude<...>> & Parti...'.
24 export const EditableAuthorTag = styled(AuthorTag)`
~~~~~~~~~~~~~~~~~
Also, I’m seeing each of these errors printed twice.
To repro:
yarn
tsc -b -f
Note that it fails with a different (apparently unrelated) error in 3.8.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:48
- Comments:23
Top Results From Across the Web
Disable waring 'Type of property circularly references itself in ...
So here the issue with js and vscode. If i say data type is /** @param {A} [data] */ the error are from...
Read more >Disable Waring 'Type Of Property Circularly References Itself ...
In JavaScript it is a runtime error to use a nonobject type on the right side of the in operator. TypeScript 4.2 ensures...
Read more >Type of property 'defaultProps' circularly references ... - Doriri
Props 전달에도 이상이 없었고 어떤 오류인가 싶어서 검색해봤다. Type of property 'defaultProps' circularly references itself in mapped type.
Read more >Type of property 'defaultProps' circularly references itself in ...
Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude& ...
Read more >Type of property 'defaultProps' circularly ... - Code Grepper
Type of property 'defaultProps' circularly references itself in mapped type 'Pick<ForwardRefExoticComponent<Pick<Pick<any, Exclude<keyof.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure if that applies for all of us, but it seems that this error appears using
typescript@^3.9.0
(particularly after this PR https://github.com/microsoft/TypeScript/pull/36696).This breaking change was mitigated by updating
@types/styled-components
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619However, this fix was deployed at
v5.0.1
of@types/styled-components
which coversstyled-components@^5.0.0
but, nothing has been deployed for earlier versions (e.g. what would coverstyled-components@^4.0.0
)So if you are using
styled-components@^5.0.0
simply runif you are using
styled-components@^4.0.0
, well then it is more difficult for now, as in essence@types/styled-components
should be updated.However, as a temporary fix it is possible to remove
@types/styled-components
from the project, copystyled-components.d.ts
file from@types/styled-components@^4.0.0
to your project and make the same fix as in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42619 e.g.:example content of styled-components.d.ts
and sorry that I’m posting this still on TypeScript repository, where it seems that DefinitelyTyped repository would be a better fit for this issue 😅
Try to use