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.
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.
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.
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:
Recommended: with a patch-level independent aka. "evergreen version" (<x.y>
) in conjunction with one of the LTS versions (1.71, 1.96, 1.108, 1.120, 1.136, ...):
<head>
<!-- ... -->
<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/<x.y>/resources/sap-ui-core.js"
data-sap-ui-async="true"
data-sap-ui-onInit="module:sap/ui/core/ComponentSupport"
data-sap-ui-resourceRoots='{ "my.app": "./" }'
data-sap-ui-...="..."
></script>
<!-- No inline script here! Avoid sap.ui.getCore().attachInit -->
</head>
<body id="content" class="sapUiBody">
<div data-sap-ui-component
data-id="myRootComponentContainer"
data-name="my.app"
data-height="100%"
data-settings='{ "id": "myRootComponent" }'
data-...="..."
></div>
</body>
With a "specific version" (<x.y.z>
):
<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/<x.y.z>/resources/sap-ui-core.js"
data-sap-ui-...="..."
></script>
For projects on GitHub: Combine the above solution with Renovate. See the blog post and the UI5con talk (vid) by Florian. This is useful to keep the specified UI5 version up-to-date.
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.
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?