Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]资源加载出错然后换一个entry, 但是name不变的话, 不会再次请求新资源 #2854

Closed
zWingz opened this issue Dec 22, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@zWingz
Copy link

zWingz commented Dec 22, 2023

What happens?

我们希望通过loadMicroApp加载资源A时, 假如资源加载失败, 比如: cdn问题或者cos问题, 会回退到另一个备份地址,然后重新加载插件. 阅读源码发现在通过loadMicroApp加载时, 会把name+containerXPath作为key缓存下来. https://github.com/umijs/qiankun/blob/master/src/apis.ts#L148. 所以如果我只改entry, 是不会重新加载, 还必须把name也改了才行.

所以这里是不是要做下catch处理? 如果异常了,则把缓存也销毁了
或者直接用name +entry 作为缓存的key

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

  • 加载一个404的资源, 失败后
  • 修改entry重新加载

相关环境信息

  • qiankun 版本 2.10.16
  • 浏览器版本
  • 操作系统
@kuitos kuitos added the bug Something isn't working label Mar 5, 2024
@kuitos kuitos added this to the 3.0 milestone Mar 5, 2024
@kuitos kuitos closed this as completed Mar 6, 2024
@hello-astar
Copy link

@kuitos 求修复v2版本

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants