micro-app icon indicating copy to clipboard operation
micro-app copied to clipboard

[micro-app] app xxx: TypeError: Failed to fetch

Open LadyChatterleyLover opened this issue 3 years ago • 6 comments

%EB93%VV39$M@MXDUH1Y7HB 加载子应用会报这个错,但是不影响使用,有办法解决这个问题吗?

LadyChatterleyLover avatar Mar 31 '22 07:03 LadyChatterleyLover

某一个js或css资源有问题,加载失败

bailicangdu avatar Mar 31 '22 07:03 bailicangdu

这个有办法排除是哪个文件出错吗?

------------------ 原始邮件 ------------------ 发件人: "micro-zoe/micro-app" @.>; 发送时间: 2022年3月31日(星期四) 下午3:43 @.>; @.@.>; 主题: Re: [micro-zoe/micro-app] [micro-app] app xxx: TypeError: Failed to fetch (Issue #350)

某一个js或css资源有问题,加载失败

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

LadyChatterleyLover avatar Mar 31 '22 07:03 LadyChatterleyLover

先确定是哪个文件,然后参考 https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/configure?id=exclude%e8%bf%87%e6%bb%a4%e5%85%83%e7%b4%a0

bailicangdu avatar Mar 31 '22 07:03 bailicangdu

好的,那我现在有办法自己确认是哪个文件吗?因为这个报错也看不出来是哪错了。

------------------ 原始邮件 ------------------ 发件人: "micro-zoe/micro-app" @.>; 发送时间: 2022年3月31日(星期四) 下午3:45 @.>; @.@.>; 主题: Re: [micro-zoe/micro-app] [micro-app] app xxx: TypeError: Failed to fetch (Issue #350)

先确定是哪个文件,然后参考 https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/configure?id=exclude%e8%bf%87%e6%bb%a4%e5%85%83%e7%b4%a0

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

LadyChatterleyLover avatar Mar 31 '22 07:03 LadyChatterleyLover

同问,我的起来也是报这个,但是我用了demo里的vue2起的服务就可以跳进去,是不是跨域设置有问题

xiejunping avatar Sep 27 '22 07:09 xiejunping

同问,我的起来也是报这个,但是我用了demo里的vue2起的服务就可以跳进去,是不是跨域设置有问题

看一下报错信息是加载哪一个文件失败?

bailicangdu avatar Sep 27 '22 07:09 bailicangdu

@bailicangdu 求助下,export const injectJS = (jsUrl, cb) => { const scriptEle = document.createElement('script'); scriptEle.type = 'text/javascript'; scriptEle.onload = function () { cb?.(); scriptEle.remove(); }; scriptEle.src = jsUrl; scriptEle.setAttribute('ignore', 'true'); document.getElementsByTagName('head')[0].appendChild(scriptEle); }; 这样写之后还是有报错,jsUrl是第三放库里面自带的请求

better-pz avatar Sep 03 '23 11:09 better-pz

@bailicangdu 求助下,export const injectJS = (jsUrl, cb) => { const scriptEle = document.createElement('script'); scriptEle.type = 'text/javascript'; scriptEle.onload = function () { cb?.(); scriptEle.remove(); }; scriptEle.src = jsUrl; scriptEle.setAttribute('ignore', 'true'); document.getElementsByTagName('head')[0].appendChild(scriptEle); }; 这样写之后还是有报错,jsUrl是第三放库里面自带的请求

报错信息是什么?

raoenhui avatar Sep 14 '23 13:09 raoenhui