Ant-design-pro: 🐛[BUG]V5 删除国际化后的问题

Created on 11 Sep 2020  ·  13Comments  ·  Source: ant-design/ant-design-pro

🐛 bug 描述

 WARNING  Compiled with 8 warnings                                                                          上午10:50:54

 warning  in ./src/.umi/plugin-layout/layout/layout/renderRightContent.tsx

"export 'SelectLang' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/layout/renderRightContent.tsx

"export 'SelectLang' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/utils/intl.ts

"export 'getLocale' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/layout/index.tsx

"export 'useIntl' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/layout/index.tsx

"export 'useIntl' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/utils/intl.ts

"export 'useIntl' was not found in 'umi'

image

📷 复现步骤


修改config.ts 移除国际化代码
image

🏞 期望结果

💻 复现代码

© 版本信息

  • Ant Design Pro 版本: V5
  • umi 版本 3.2.20
  • 浏览器环境 edge
  • 开发环境 windows10

🚑 其他信息

Inactive 🛑 bug

Most helpful comment

  • config/config.ts 中增加 locale: {}
  • 新建文件 src/locales/zh-CN.ts ,文件中写 export default {}
  • 重启服务

当前版本 "umi": "^3.2.22"

All 13 comments

看起来是 https://github.com/umijs/plugin-layout 的问题,好像没人维护的样子😂

删除了国际化要顺便把 locale 设置为false,然后重启一下项目,会重新生成这个dom

删除了国际化要顺便把 locale 设置为false,然后重启一下项目,会重新生成这个dom

没有用
image

我也遇到了这个问题

删除了国际化要顺便把 locale 设置为false,然后重启一下项目,会重新生成这个dom

这个删除了后不生效,需要怎么改吗

The same question.

遇到同样的问题,按照官网新建项目,dev启动就有一堆warning

我也遇到了同样的问题:

 WARNING  Compiled with 5 warnings                                                                                                                                                                                 5:27:27 ├F10: PM┤

 warning  in ./src/.umi/plugin-layout/layout/layout/renderRightContent.tsx

"export 'SelectLang' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/layout/renderRightContent.tsx

"export 'SelectLang' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/utils/intl.ts

"export 'getIntl' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/utils/intl.ts

"export 'getIntl' was not found in 'umi'

 warning  in ./src/.umi/plugin-layout/layout/utils/intl.ts

"export 'getLocale' was not found in 'umi'

👪 现在先忽略吧,都是 warning,要解决的需要很大的成本。有人有兴趣提个 pr 吗?

  • config/config.ts 中增加 locale: {}
  • 新建文件 src/locales/zh-CN.ts ,文件中写 export default {}
  • 重启服务

当前版本 "umi": "^3.2.22"

  • config/config.ts 中增加 locale: {}
  • 新建文件 src/locales/zh-CN.ts ,文件中写 export default {}
  • 重启服务

当前版本 "umi": "^3.2.22"

IT WORKS REALLY.

  • config/config.ts 中增加 locale: {}
  • 新建文件 src/locales/zh-CN.ts ,文件中写 export default {}
  • 重启服务

当前版本 "umi": "^3.2.22"

It worked to me, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaoding picture kaoding  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

2uncle-code picture 2uncle-code  ·  3Comments

zhongjiewu picture zhongjiewu  ·  3Comments