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

子应用如果是使用react.lazy做懒加载的 spa应用,那么在子应用内跳转到懒加载路由时,加载失败的问题 #293

Closed
yangdm2015 opened this issue Apr 27, 2021 · 5 comments · Fixed by #306
Labels
bug Something isn't working

Comments

@yangdm2015
Copy link

Do you want to request a feature or report a bug?
bug
What is the current behavior?
子应用内跳转到懒加载路由时,加载失败。
比如主应用起在3022,子应用起在3023,子应用跳到懒加载的页面,network显示请求了http://localhost:3022/js/0.j ,这不对

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
步骤
1.使用脚手架创建子应用和主应用,启动主子应用。
2.将主应用的本地地址配置在主应用的apps中(配置了sandbox),并在菜单中配置链接。
3.在子应用中的列表和详情中增加互相跳转的链接,单独起子应用,互相跳转ok
4.子应用中新增一个懒加载的页面,在子应用中的列表和详情中增加跳转到这个懒加载页面的链接 单独起子应用,互相跳转ok
5.在主应用中打开子应用,点击非跳转到懒加载页面的链接,跳转正常
6.在主应用中打开子应用,点击跳转到懒加载页面,报加载失败.
What is the expected behavior?
期望第6步正常加载

@yangdm2015
Copy link
Author

补充:子应用的build.json中配置publicPath和devPublicPath. 在主应用中点击懒加载的子应用的地址,network显示的请求地址符合预期,但还是报请求failed(但看起来是执行报错)

@yangdm2015
Copy link
Author

image

@ClarkXia
Copy link
Collaborator

先确认下是否是 文档 中提到的 lazy 加载失败的情况,如果不是提供下主子应用的 demo

@maoxiaoke
Copy link
Collaborator

@yangdm2015 暂时先不开启 sandbox 能力,这个我们排查下

@maoxiaoke maoxiaoke added the bug Something isn't working label Apr 27, 2021
@yangdm2015
Copy link
Author

@yangdm2015 暂时先不开启 sandbox 能力,这个我们排查下

关闭了相应子应用的sandbox能力后,没有问题了。但这应该也是个bug,估计是你们沙箱出问题了

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

Successfully merging a pull request may close this issue.

3 participants