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

excludeAssetFilter配置首次加载子应用时有效,子应用卸载重新加载依旧报错 #1011

Open
yang1191681949 opened this issue Dec 19, 2023 · 4 comments
Labels

Comments

@yang1191681949
Copy link

          > 最新版本已支持excludeAssetFilter,使用方式
import microApp from '@micro-zoe/micro-app'

microApp.start({
  excludeAssetFilter (assetUrl) {
    if (assetUrl === 'xxx') {
      return true // 返回true则micro-app不会劫持处理当前文件
    }
    return false
  }
})

用这种方法首次加载子应用的时候没问题,子应用卸载之后再次加载还是出现问题了。
image
我这边是排除了Cesium相关的文件,子应用卸载后再次加载报错,跟没有排除的报错是一样的。
image
可以帮忙看看什么原因吗

Originally posted by @yang1191681949 in https://github.com/micro-zoe/micro-app/issues/525#issuecomment-1862532137

@bailicangdu
Copy link
Contributor

能提供一个demo看一下吗

@bailicangdu bailicangdu added the Need Reproduction 需要复现步骤 label Dec 20, 2023
Copy link

Hello @yang1191681949. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository.
您好 @yang1191681949, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。

@yang1191681949
Copy link
Author

yang1191681949 commented Dec 22, 2023

能提供一个demo看一下吗

您好,这个demo不太方便提供,我这边测试时发现,excludeAssetFilter函数每次在子应用加载时都会触发,如果我给micro-app配置了destroy时,只有首次触发的时候,才会有我想要排除的文件的url,第二次加载触发时,不会出现我想要排除的url文件,但是没有报那个错误,如果我不给micro-app配置destroy,而是在子应用main.js卸载应用,报错就出现了,麻烦您根据这个方向去查一下问题,具体截图如下。
image
image
image
以上情况是给micro-app配置了destroy的结果,如果不配置destroy,而是在子应用增加window.unmount回调中卸载应用的话,会是下面的结果
image
image
image

@bailicangdu bailicangdu removed the Need Reproduction 需要复现步骤 label Dec 22, 2023
@yang1191681949
Copy link
Author

能提供一个demo看一下吗

您好,这个demo不太方便提供,我这边测试时发现,excludeAssetFilter函数每次在子应用加载时都会触发,如果我给micro-app配置了destroy时,只有首次触发的时候,才会有我想要排除的文件的url,第二次加载触发时,不会出现我想要排除的url文件,但是没有报那个错误,如果我不给micro-app配置destroy,而是在子应用main.js卸载应用,报错就出现了,麻烦您根据这个方向去查一下问题,具体截图如下。 image image image 以上情况是给micro-app配置了destroy的结果,如果不配置destroy,而是在子应用增加window.unmount回调中卸载应用的话,会是下面的结果 image image image

对了,以上问题是使用this.$router.push({ path: url })跳转到子应用时出现的,我目前使用window.location.href = url跳转子应用就没问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants