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
icestark IE11下子应用始终加载失败 #3661
Comments
appConfig没有具体子应用信息? |
{ 子应用是使用entry加载的。polyfill需要怎么引入呢?编译配置项injectBabel使用默认值不会自动引入么? |
https://github.com/github/fetch 可以使用这个包覆盖 window 上的 fetch 方法 |
👌 我试试 |
|
错误信息是什么,ErrorComponent 可以输出底层抛的错误 |
浏览器url:https://xxxxxxxx/gpx-ice/gpx-subapp/#/ IE11下子应用资源加载url拼接不对,我们子应用使用entry加载;icestark框架使用browser路由,子应用使用hash路由。 这个是不是框架BUG?? |
IE11下,子应用资源url地址拼接错误了 |
IE 11 下 parseUrl 逻辑有问题 https://github.com/ice-lab/icestark/blob/master/src/util/handleAssets.ts#L192 |
@ice/stark@1.6.0-2 beta 版本已修复 |
build-plugin-icestark要升级到哪个版本哈?当前@ice/stark 1.5.6 ;build-plugin-icestark 1.7.0; |
@ice/stark 版本升级即可 |
好像不行吧?我们没有直接使用@ice/stark,使用的build-plugin-icestark,而这个插件依赖"@ice/stark": "^1.3.1",会自动去安装1.5.6版本 |
先使用 beta 版:build-plugin-icestark@1.7.2-2 |
content-type 在 response header 中,一般不用主动设置,可以直接代理 window.fetch,排查下具体原因,fetch 资源本身就受跨域等限制: window.fetch = (url) => {
return Promise.resolve({
text: () => 'const error = 1;',
});
}; |
我们排查了很久,没有找到具体原因。目前以下操作必现: ※主应用browser路由,子应用hash路由,通过entry方式加载子应用 其中,appMain为icestark主应用,appSub为子应用,subRouter为子应用路由。 |
官方 demo 在 ie11 中无法复现上述问题(引入 whatwg-fetch 后正常运行),可以提供下简单的复现 demo 方便排查 |
官方demo地址能贴下吗?我在我本机访问下是否正常。如果正常,我再提供我们应用的demo。 |
直接使用 https://github.com/alibaba/ice/tree/master/examples/icestark-layout <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" />
<meta name="viewport" content="width=device-width" />
<title>icejs</title>
<link href="//ice.alicdn.com/icestark/child-seller-react/index.css" rel="stylesheet">
</head>
<body>
<script type="text/javascript" src="//ice.alicdn.com/icestark/child-seller-react/index.js"></script>
</body>
</html> public 下的资源可以通过 http 访问: |
👌 我试试 |
如果还能复现,提供复现下 demo |
最近还没空复现 等复现了 回复你 |
1.Chrome下应用能正常访问
2.IE11下,框架和子应用分别独立访问可正常访问
3.IE11下框架应用始终命中ErrorComponent,提示子应用加载失败,F12查看控制台无任何报错
4.框架appConfig配置如下:
icestark: { type: 'framework', Layout: FrameworkLayout, getApps: async () => { }, appRouter: { basename: '/', ErrorComponent: <div style={{ fontSize: "18px" }}>应用有更新,请<a style={{ color: "#1375d8", cursor: "pointer", }} onClick={() => { window.location.reload(); }}>刷新应用</a></div>, LoadingComponent: <div> </div>, }, },
发生了什么?
复现步骤,错误日志以及相关配置
期望的结果是什么
IE11下能正常访问应用
相关环境信息
The text was updated successfully, but these errors were encountered: