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

同时加载多个子应用,卸载后再打开白屏,single-spa minified message #31 #2692

Open
Echonessy opened this issue Sep 19, 2023 · 1 comment

Comments

@Echonessy
Copy link

What happens?

打开tabA、打开tabB,关闭tabA,再打开tabA qiankun会挂载失败 single-spa minified message #31

/**
 * @description: 2.4.4
 * @return {*}
 */
  const appInstanceId = `${appName}_${+new Date()}_${Math.floor(Math.random() * 1000)}`;
/**
 * @description: >2.4.4
 * @return {*}
 */
export const genAppInstanceIdByName = (appName: string): string => {
  const globalAppInstanceMap = getGlobalAppInstanceMap();
  if (!(appName in globalAppInstanceMap)) {
    nativeGlobal.__app_instance_name_map__[appName] = 0;
    return appName;
  }

  globalAppInstanceMap[appName]++;
  return `${appName}_${globalAppInstanceMap[appName]}`;
};

  const appInstanceId = genAppInstanceIdByName(appName);

这样会导致一个问题,就是我tabA unmount之后, globalAppInstanceMap[appName]++; 会从头开始计算,但是已经unmount了

最小可复现仓库

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

打开tabA、打开tabB,关闭tabA,再打开tabA qiankun会挂载失败 single-spa minified message #31

相关环境信息

  • qiankun 版本 2.9.0
  • 浏览器版本:chrome
  • 操作系统
@gongshun
Copy link
Collaborator

关闭 tabA,需要手动卸载这个子应用

#1734 (comment)

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

2 participants