qiankun
qiankun copied to clipboard
node_modules/history/index"' has no exported member 'LocationState'.
复现步骤,错误日志以及相关配置
If the 'history' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history'
相关环境信息
- qiankun 版本
- `{ "name": "qiankun", "version": "2.6.3", "description": "A completed implementation of Micro Frontends", "keywords": [ "micro frontend", "microfrontend", "micro frontends", "micro-frontend", "micro-frontends", "microservice" ],
`
- 浏览器版本: chrome
- 操作系统: m1
能复现,是否是 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'
[email protected]:
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
这个报错还存在吗? https://github.com/umijs/qiankun/issues/1969#issuecomment-1059910501
我也是遇到同样的问题,清一下yarn缓存就好了。 yarn cache clean
yarn add -D @types/[email protected]