Open bigcui opened 2 years ago
能复现,是否是 react-router-dom 库的 history 依赖,导致 react-router-config 代码中对 history 的类型推断报错了?
XXX/fe_learn/qiankun/node_modules/@types/react-router-config/index.d.ts(12,26): error TS7016: Could not find a declaration file for module 'history'. 'XXX/fe_learn/qiankun/node_modules/history/index.js' implicitly has an 'any' type.
If the 'history' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history'
react-router-dom@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.2"
react-router "5.2.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
同样问题+1
+1
我也是遇到同样的问题,清一下yarn缓存就好了。 yarn cache clean
yarn add -D @types/history@4.7.9
复现步骤,错误日志以及相关配置
If the 'history' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history'
相关环境信息
`