umijs / qiankun

📦 🚀 Blazing fast, simple and complete solution for micro frontends.
https://qiankun.umijs.org
MIT License
15.72k stars 2k forks source link

node_modules/history/index"' has no exported member 'LocationState'. #1976

Open bigcui opened 2 years ago

bigcui commented 2 years ago

复现步骤,错误日志以及相关配置

If the 'history' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/history'

相关环境信息

`

lvchengli commented 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"
taoqiyang commented 2 years ago

同样问题+1

raylee996 commented 2 years ago

+1

gongshun commented 2 years ago

这个报错还存在吗? https://github.com/umijs/qiankun/issues/1969#issuecomment-1059910501

RicardoBiao commented 2 years ago

我也是遇到同样的问题,清一下yarn缓存就好了。 yarn cache clean

wuchuheng commented 2 years ago

yarn add -D @types/history@4.7.9