【问题标题】:Could neither find styled-components secret internals既找不到样式组件的秘密内部结构
【发布时间】:2020-05-08 15:29:50
【问题描述】:

我目前正在尝试更新到 Styled Components 5.0.0,但我遇到了一些问题,我的 JEST 测试停止工作。我已经降级到 4.2.1,但仍然更新了 babel@preset-react、preset-env、core 和其他一些包。当我尝试运行 npm test 时出现此错误:

“Could both find styled-components secret internals”指向import 'jest-styled-components';Jest-styled-components 也更新到7.0.0

【问题讨论】:

  • 众所周知,github 上有一个未解决的问题正在谈论它here

标签: reactjs testing jestjs styled-components


【解决方案1】:

https://github.com/styled-components/jest-styled-components/issues/301#issuecomment-893170436

改成 yarn add jest-styled-components@6.3.4 解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-16
    • 1970-01-01
    • 2019-10-12
    • 1970-01-01
    • 2019-04-10
    • 2021-08-14
    相关资源
    最近更新 更多