Skip to Content
Jun 20, 2022 at 10:57 AM

SAP BTP MTA UI5 on node - how to reference BTP resources/sap-ui-core.js


In the old world, in our index.html files we had this line pointing to our relative UI5 resources: src="recources/sap-ui-core.js" and this happily used the UI5 resources relative to the application, be that on premise or on cloud.

When I build an app in SAP Business Application Studio, this is still the case in the index.html file.

However I am working on an application where this doesn't work. The app has a node server, and that's the only thing I can think of that could be causing the issue. The app deploys to BTP as an MTA totally fine, and works perfectly if we provide OpenUI5 as the source:

But when we are running this application on BTP we want to use the relative libraries, since that would give better performance (and the BTP license means we are allowed to use actual UI5, rather than having to lean on the open version).

I've read so many articles about applications built with node but any which supply code always seem to point to an absolute URL for the UI5 resources.

I have tried adding "../" in front of the "resources/sap-ui-core.js" to make sure it's not looking within a folder of the app itself, but I suspect this isn't helping. I don't know if I can force it to "jump" out of the app world and look at BTP instead within the local files of the application.

Thank you in advance for any thoughts and advice. I may be missing something simple or asking for the impossible..