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

从v3升级到v4 No matching export in "src/.umi/exports.ts" for import "useModel" #12378

Closed
qiyaozu opened this issue May 11, 2024 · 4 comments

Comments

@qiyaozu
Copy link

qiyaozu commented May 11, 2024

image
@Wu-kung
Copy link
Contributor

Wu-kung commented May 11, 2024

清空缓存,重装依赖试下呢。

rm -rf node_modules && rm -rf src/.umi && pnpm install

@qiyaozu
Copy link
Author

qiyaozu commented May 11, 2024

其实这个步骤我已经做过了 还是你不行

@Wu-kung
Copy link
Contributor

Wu-kung commented May 11, 2024

其实这个步骤我已经做过了 还是你不行

抱歉,useModel useIntl@umi/max 内置的能力。如果使用了 @umijs/max 可以使用 max 命令来替换 umi

详细可参考:https://umijs.org/docs/introduce/upgrade-to-umi-4

@fz6m
Copy link
Member

fz6m commented May 14, 2024

umi 4 分为 umi 和 max (@umijs/max) ,前者不内置任何插件,如果需要 model / dva 等功能要自己添加这些插件,后者内置了一堆插件,方便直接开启使用。

普通 umi 项目要使用某个功能,只要安装 @umijs/plugins 然后配一下就行了,参考:使用插件

你这里需要配一下 plugins: ['@umijs/plugins/dist/model']model: {} ,如果还用到了其他功能,需要一起都配置打开,或者就使用 max ,省去安装 @umijs/plugins 和配置 plugins: [...]

@fz6m fz6m closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants