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

子应用 前端资源更新时, 请求老的资源,错误无法捕获 #2895

Open
yaolinhong opened this issue Jan 31, 2024 · 1 comment
Open

Comments

@yaolinhong
Copy link

场景: 前端资源更新时 只有css更新,css哈希值变化 老的css资源无法请求到的场景

调用栈中 定位到 错误是在forStrictSandbox rawHeadAppendChild.call(mountDom, stylesheetElement);

控制台有error

GET http://saas-test2.raritag.cn/sub-app-materials-inventory/css/materialsList.4663284c.css net::ERR_ABORTED 404 (Not Found)

https://github.dev/umijs/qiankun/blob/cbd6cc064624be31a5f5f972d37075471ac7b15a/src/sandbox/patchers/dynamicAppend/forStrictSandbox.ts

问题: 主应用、子应用中 addGlobalUncaughtErrorHandler 无法捕获到错误

image

@yaolinhong yaolinhong changed the title [Bug]请遵循下文模板提交问题,否则您的问题会被关闭 前端资源更新时 只有css更新,css哈希值变化 老的css资源无法请求到 错误无法捕获 Jan 31, 2024
@yaolinhong yaolinhong changed the title 前端资源更新时 只有css更新,css哈希值变化 老的css资源无法请求到 错误无法捕获 前端资源更新时, 错误无法捕获 Jan 31, 2024
@yaolinhong yaolinhong changed the title 前端资源更新时, 错误无法捕获 子应用 前端资源更新时, 错误无法捕获 Jan 31, 2024
@yaolinhong yaolinhong changed the title 子应用 前端资源更新时, 错误无法捕获 子应用 前端资源更新时, 请求老的资源,错误无法捕获 Jan 31, 2024
@yaolinhong yaolinhong reopened this Jan 31, 2024
@bravepg
Copy link
Contributor

bravepg commented Feb 4, 2024

addGlobalUncaughtErrorHandler 里面的回调函数没有被执行吗?

如果你说的没有被捕获指的是「控制台中看到浏览器的错误输出」,那么你需要在回调函数里使用 event.preventDefault() 来阻止浏览器的默认行为。

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