-
Notifications
You must be signed in to change notification settings - Fork 171
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
feat: again load source fail should catch error #97
Conversation
qiYuei
commented
Sep 21, 2023
•
edited by kuitos
Loading
edited by kuitos
- resolve qiankun劫持的资源首次加载失败后,后续加载都不会触发资源的 error事件 umijs/qiankun#2696
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -246,6 +246,9 @@ export function execScripts(entry, scripts, proxy = window, opts = {}) { | |||
} | |||
|
|||
return new Promise(resolve => schedule(0, success || resolve)); | |||
}).catch((e) => { | |||
error(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 catch 的话 getExternalScripts 那里就不要再 catch 了,不然 error callback 会被调用两次
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实. Done!
src/index.js
Outdated
errorCallback(); | ||
throw e; | ||
})); | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接删了就行,包括入参及调用那里的代码
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM