2
votes

I've created a custom SAPUI5 library with the SAP Web IDE and deployed the library to the SAP Cloud Platform. The library is used by multiple SAPUI5 applications and works perfect when the apps are launched from the SAP Web IDE. The dependency to the library is defined in the manifest.json of each application:

"dependencies": {"libs": {"custom.library"}: {}}}

Furthermore I've already added the correct path to the file neo-app.json.

Now I've registered the SAPUI5 applications to the SAP Cloud Platform Fiori Launchpad. I can start the Launchpad and see the tiles for the apps. But when I start an app the following error occurs: Error: failed to load 'custom/library/library.js' from https://sapui5.hana.ondemand.com/1.52.17/resources/custom/library/library.js: 404

How can I register the custom UI5 library to the Fiori Launchpad?

2

2 Answers

0
votes

On SAP Community, you’ll find this blog about the SAPUI5 Custom control library. There it says that you need to add an entry into “routes” array of neo-app.json file for your newly deployed library. The entry shall look like this:

{
       "path": "/webapp/resources/my/custom/control",
       "target": {
             "type": "application",
             "name": "mycustomlib", 
             "entryPath": "/"
       },
       "description": "Custom control library"
}

Here, “path” is the path you use in the dependency definition of your controller JS file. “name” in “target” clause contains the name under which you deployed the library into SAP Cloud Platform.

0
votes

As SAP Fiori Crew pointed out, you need to create a route entry in neo-app.json for the SAP Cloud Platform router to know where to serve your library files from when requested by the applications.

A good way to find out the exact URL that needs to be added is checking the Network requests in your browser's Developer Tools, when trying to load the application in the Launchpad:

Failed request to the library-preload.js in a Cloud Fiori Launchpad

In the example above, adding this entry to neo-app.json solved the problem:

{
    "path": "/sap/ui5/1/resources/vplanner/common",
    "target": {
        "type": "application",
        "name": "vpfioricommon"
    },
    "description": "Common Library"
}