qiankun icon indicating copy to clipboard operation
qiankun copied to clipboard

乾坤捕获不到分项目vue语法错误,控制到没有报错信息

Open yaoyuanrong opened this issue 2 years ago • 7 comments

背景: 线上环境,server传给我的一个列表数据缺少了某个关键字段,导致前端报错(本地开发能看到报错信息)列表渲染直接失败,整个页面假死。但是线上环境打开控制台看不到报错信息,前端很难去追查问题,无法快速定位问题 image

思路: 能不能把分项目的报错信息透传到主项目上呢? 版本: qiankun: [2.0.16] chrome:103.0.5060.114(正式版本) 希望技术大大们有个反馈信息,谢谢各位

yaoyuanrong avatar Jul 16 '22 09:07 yaoyuanrong

大概率是因为你用了try catch 把报错拦截了

gongshun avatar Jul 18 '22 02:07 gongshun

应该不是,我最后用Vue.config.errorHandler坚挺vue报错,然后 window.console.error 把错误信息在全局环境中打印出来才好使的

yaoyuanrong avatar Jul 18 '22 02:07 yaoyuanrong

Hello @yaoyuanrong. In order to facilitate location and troubleshooting, we need you to provide a realistic example. Please forking these link codesandbox or clone qiankun examples to your GitHub repository.

你好 @yaoyuanrong, 为了方便定位和排查问题,我们需要你提供一个重现实例,请提供一个尽可能精简的链接 codesandbox 或直接 clone qiankun examples,并上传到你的 GitHub 仓库。

github-actions[bot] avatar Jul 28 '22 03:07 github-actions[bot]

应该不是,我最后用Vue.config.errorHandler坚挺vue报错,然后 window.console.error 把错误信息在全局环境中打印出来才好使的

找到解决之法了么

Caveolaes avatar Aug 09 '22 15:08 Caveolaes

在子项目的main.js加入 Vue.config.errorHandler = function (err, vm, info) { window.console.error('VueError', err, vm, info); };

yaoyuanrong avatar Aug 10 '22 06:08 yaoyuanrong

会不会和qiankun无关,我试了一下,vue-cli4+ , vue2.6+的版本进行打包,在没有加入Vue.config.errorHandler 的情况下,打包后的产物中发生ReferenceError被catch掉了,感觉和vue中的glob 11111 alHandleError,logError有关,我还没有完全定位出来

HHH1994 avatar Aug 31 '22 07:08 HHH1994

会不会和qiankun无关,我试了一下,vue-cli4+ , vue2.6+的版本进行打包,在没有加入Vue.config.errorHandler 的情况下,打包后的产物中发生ReferenceError被catch掉了,感觉和vue中的glob 11111 alHandleError,logError有关,我还没有完全定位出来

看上去把生产环境的报错直接try catch掉了,我后续在看看

yaoyuanrong avatar Aug 31 '22 07:08 yaoyuanrong

Since the issue was labeled with Need Reproduction, but no response in 30 days. This issue will be close. If you have any questions, you can comment and reply. 由于该 issue 被标记为需要可复现步骤,却 30 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

github-actions[bot] avatar Oct 01 '22 00:10 github-actions[bot]