Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: @types/styled-components 的 5.1.25 版本将 react 的 type 升级到了 18,导致原有代码无法通过编译 #1270

Closed
nervouself opened this issue Jun 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@nervouself
Copy link

版本信息

"@modern-js/runtime": "1.3.2",
"@modern-js/runtime-core": "1.5.1",
"@modern-js/app-tools": "1.6.6",

问题详情

packages/runtime 引用了 @types/styled-components

@types/styled-components 的 5.1.25 版本将 react 的 type 升级到了 18,导致原有代码无法通过编译

@types/styled-components 的改动可见:
DefinitelyTyped/DefinitelyTyped@55dc209

复现链接

更新安装,让 @types/styled-components 为 5.1.25 即可

复现步骤

更新安装,让 @types/styled-components 为 5.1.25 即可

@nervouself nervouself added the bug Something isn't working label Jun 24, 2022
@chenjiahan
Copy link
Member

可以先通过 yarn resolutions 或 pnpm overrides 锁一下 @types/react 的版本,我们后续看下怎么处理

@chenjiahan
Copy link
Member

试了下,@types/styled-components >= 5.0.0 都有此问题,目前来说, resolutions 是最合适的解决方法。

@types/styled-components 的问题需要等待社区去解决了。相关 issue:DefinitelyTyped/DefinitelyTyped#59765

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants