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.

    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:

    SAP removes SAPUI5 versions from the SAPUI5 CDN one year after their end of maintenance. In addition to this also patches of versions in maintenance which are older than one year will be removed.

    To reduce the chance of being affected by such removals, or to benefit from continuous framework fixes and other improvements in one of the long-term maintenance releases automatically, bootstrap UI5 with the "evergreen version" as shown below.

    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 ui5.sap.com/versionoverview.html (SAPUI5*) or sdk.openui5.org/versionoverview.html (OpenUI5), and <x.y.z> referring to the major.minor.patch version respectively:

    This is especially important for apps that still use deprecated APIs if they keep relying on the "default version" since deprecated APIs will be removed in the next UI5 major version (aka. "Legacy-free UI5") automatically.

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

    * When using the SAPUI5 CDN, please review the SAP Note 2943781 - Is the usage of SAP's Content Delivery Network for onPremise systems permitted?

    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 as the component.