sapui5cdnakamai

SAPUI5 has suddenly internal load resource error despite no changes in the app


I am using the sap.ui.comp.smarttable.SmartTable control in some SAP Cloud Foundry UI5 apps.

Since a week or so, the table control cannot render anymore using the current release (1.74.1) as the following XHR load fails:

https://sapui5.hana.ondemand.com/resources/sap/ui/table/TableExtension.js

If I force the usage of an older release - eg '1.73.1' - then it works fine and the above resource is found.

Is there something changed with the 'Smart Table' concept I am not aware of or is this an issue with the library itself?

I checked the change logs for UI5 but didn't see anything mentioned there.


Solution

  • Cause

    CDN: Inconsistently cached framework resources

    The change in the commit 5e3848d, available since UI5 core 1.74.0, shows that the file TableExtension.js was renamed to ExtensionBase.js and moved to the new extensions directory. So sap/ui/table/extensions/ExtensionBase.js should've been fetched. But that refactoring is not the actual cause of the issue. According to Andreas Kunz, UI5 had a cache invalidation issue in CDN.

    Your browser might have also reported misleadingly that the requested resource has been "blocked by CORS policy" but this is simply because the 404-response itself has no 'Access-Control-Allow-Origin' header. The issue is not related to CORS.

    The fact that such cache issues or UI5 internal changes affect your application indicates that your application is bootstrapping UI5 with a default version of the CDN URL. E.g. in index.html:

    src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" <-- default version

    The "default version" is intended only for tutorial or testing purposes. See the resolution below.

    Apps: Relying on outdated SAPUI5 versions

    In the browser console (F12), you might see the error log "sap is not defined". SAP removes outdated UI5 versions from the CDN according to the notes 3001696 and 3314374 for security reasons.

    Resolution

    Apps running in productive system

    Apps, that run on a productive system and using UI5 resources externally from the standard CDN at the same time, must specify a UI5 version in the URL as documented in the topic Variant for Bootstrapping from Content Delivery Network.

    Based on the SAPUI5[1]/OpenUI5 version overview, and <x.y.z> referring to the major.minor.patch version respectively:

    Note: the hostname *.hana.ondemand.com for bootstrapping UI5 is outdated. Replace it with ui5.sap.com (SAPUI5)[1] or sdk.openui5.org as per the announcement "Short and Powerful: Convenient URLs for SAPUI5/OpenUI5 CDN" | SAP Blogs.

    In other cases

    See if the issue gets resolved after:

    If the issue is still reproducible, create an incident from SAP Support with CA-UI5-DLV.


    [1] If you plan to use SAPUI5 CDN, please double check: 2943781 - Is the usage of SAP's Content Delivery Network for onPremise/private cloud systems permitted?