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

子应用卸载后执行了defer脚本。TypeError: Cannot read properties of null (reading 'microBody') #1212

Open
yingyuk opened this issue May 13, 2024 · 0 comments · May be fixed by #1213
Assignees
Labels
bug Something isn't working TODO

Comments

@yingyuk
Copy link

yingyuk commented May 13, 2024

问题描述

问题的具体描述
子应用 A 包含了请求耗时较长的 defer 或者 async 脚本。当这些脚本尚未下载完成时,如果切换到另一个子应用 B,子应用 A 将会被卸载。在脚本下载完成后,当 execScripts 函数中的 promiseStream 执行 runScript 时,由于子应用 A 已经被卸载,就会导致读取 app.sandBox!.microBody 时出现错误。

复现步骤

  1. 访问 stackblitz demo
  2. 等待 npm 依赖安装完成 启动应用后,打开控制台查看报错

环境信息

  • micro-app版本:1.0.0-rc.5
yingyuk added a commit to yingyuk/micro-app that referenced this issue May 13, 2024
@bailicangdu bailicangdu added bug Something isn't working TODO labels May 15, 2024
@bailicangdu bailicangdu self-assigned this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working TODO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants