SAP UI5应用白屏的原因分析

简介: SAP UI5应用白屏的原因分析

Today I am working on another incident and I get to know another kind of reason which will lead to empty screen issue in UI.

My previous experience for potential reason of empty screen issue is, there must be some JavaScript execution error which causes the UI ceases to render.


The issue I am working on today: Say in system A when I try to create a follow up Opportunity based on a lead,



image.pngimage.png

image.pngI could only see an empty screen. However in another system B, the followup navigation works correctly.image.pngMy issue analysis process

Step1. Check whether there are JavaScript error in console

During my past issue handling life, every time I find JavaScript error in console, I then realize the error is caused by the bug in our code, I fix the bug, then empty screen issue is gone. Unfortunately for this issue, there are not JavaScript error in console at all. All messages you see here is printed out via jQuery.sap.assert, which will not stop UI rendering.


Meanwhile I have also checked in system B where the navigation from Lead to Opportunity application works correctly with these same assertion message displayed. So the messages here should NEVER be considered as issue root cause.


Note: The screenshot of this blog with white background color are made from system A ( navigation DOES NOT work ), and the one with black background color from system B ( navigation works ).



image.png

image.pngStep2. Compare what resources have been loaded in both systems

In our system B, the creation page of Opportunity, S5.view.xml and S5.controller.js have been successfully loaded, which could be found in console tab:



image.png

image.pngHowever in system A, S5.controller.js is not there. So this hint should be used as a breakthrough for finding root cause.image.pngStep3. Find out why S5.controller.js fails to be loaded in system A

You don’t know where to set breakpoint to start debugging? In system B where the navigation from Lead to Opportunity can work, type “S5.” in Network filter to filter the HTTP request to load S5.view.xml, then hover your mouse under column “Initiator”. Then the callstack to download this xml file is displayed. Just click any one of callstack frame and you will automatically reach the position of source code.


image.png

image.pngThen you can set breakpoint and start debugging.

image.pngStep4. Debug in both systems simultaneously to compare the difference

In this line the expected navigation target is parsed from route configuration.


image.png

image.pngBrief introduction on screenshot above:


(1) route configuration is provided by application code Component.js or in manifest.json in higher UI5 version.

In Opportunity application, the route configuration is defined in Component.js.



image.png

image.png(2) The pattern with name “FollowupFromLead” in above picture has successfully matched to the input hash string: followupfromlead/Leads(guid’3440B5B1-73AE-1EE5-9DC6-FB90180B87AA’)/OPPT


image.png

image.pngimage.pngAnd when I debug in system A, I find I enter the ELSE branch:image.pngThe warning message in console has already told us the root cause: It is application’s fault that it fails to provide a target UI to render.image.pngJust compare the two Component.js in both systems and I find the root cause. There is a note which adds route “FollowupFromLead” which is missing in system A. Once the note is applied, the empty screen issue will be resolved.


image.png

image.pngimage.png

相关文章
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之七十三 - 使用自定义 Query 实现 SAP UI5 页面路由的书签功能试读版
SAP UI5 应用开发教程之七十三 - 使用自定义 Query 实现 SAP UI5 页面路由的书签功能试读版
|
Web App开发 开发者
SAP UI5 应用开发教程之三十九 - SAP UI5 应用出现白屏的一些常见错误和分析方法分享试读版
SAP UI5 应用开发教程之三十九 - SAP UI5 应用出现白屏的一些常见错误和分析方法分享试读版
|
Web App开发 开发者
SAP UI5 应用开发教程之四十二 - SAP UI5 自带的 Diagnostics 诊断工具使用方法介绍
SAP UI5 应用开发教程之四十二 - SAP UI5 自带的 Diagnostics 诊断工具使用方法介绍
|
开发者
SAP UI5 应用开发教程之二十九 - SAP UI5 的路由和导航功能介绍试读版
SAP UI5 应用开发教程之二十九 - SAP UI5 的路由和导航功能介绍试读版
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之八十二 - 采用 OPA5 开发支持页面跳转的 SAP UI5 集成测试用例试读版
SAP UI5 应用开发教程之八十二 - 采用 OPA5 开发支持页面跳转的 SAP UI5 集成测试用例试读版
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之七十二 - SAP UI5 页面路由的动画效果设置试读版
SAP UI5 应用开发教程之七十二 - SAP UI5 页面路由的动画效果设置试读版
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之六十九 - 如何从 SAP UI5 Not Found 页面跳转回到正常的应用页面试读版
SAP UI5 应用开发教程之六十九 - 如何从 SAP UI5 Not Found 页面跳转回到正常的应用页面试读版
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之六十五 - 基于 OData V4 的 SAP UI5 表格控件如何实现创建,编辑和保存功能试读版
SAP UI5 应用开发教程之六十五 - 基于 OData V4 的 SAP UI5 表格控件如何实现创建,编辑和保存功能试读版
|
Web App开发 前端开发 JavaScript
SAP UI5 应用开发教程之六十六 - 基于 OData V4 的 SAP UI5 表格控件如何实现删除功能试读版
SAP UI5 应用开发教程之六十六 - 基于 OData V4 的 SAP UI5 表格控件如何实现删除功能试读版
|
XML JavaScript 前端开发
SAP UI5应用白屏的原因分析
SAP UI5应用白屏的原因分析
SAP UI5应用白屏的原因分析