cancel
Showing results for 
Search instead for 
Did you mean: 

Load local UI5 library while using fiori-tools-proxy

wridgeu
Participant
0 Kudos

Hi everyone,

I have a similar question to Fiori Tools - fiori-tools-proxy - Direct load & fiori-tools-servestatic issue in BAS | SAP Community.

I'm using the "fiori-tools-proxy" to serve (& preview) the LTS UI5 version "1.71.XX" within an FLP Sandbox.

When adding a custom library, for example the promisified V2 OData Model from Mauricio via npm (both normal dependency and "ui5" + adding it into the manifest under "libs". I'm facing the issue that, due to the aforementioned "fiori-tools-proxy" usage and it's proxying of the UI5 resources, I end up getting requests to "https://ui5.sap.com/1.71.33/resources/openui5/model/odata/v2/library.js" which obviously does not exist there.

The app preview is run via the command "fiori run → start" with the flpSandbox.

When running it locally (start-local), without proxying, it works however, I don't want to run it fully on local resources as the earliest version I can get here is "1.76.XX" and not the LTS "1.71.XX" version. Arguably this doesn't make too much of a difference and one could neglect that in theory.

I've also tried to use the Serve Static without success though. I thought I should be able to somehow add another proxy for anything going against "/resources/openui5" to load from my local resources. Maybe I need to go an old route and add/map this to the "resources" folder myself in this scenario?

If there is anything missing to better understand the question, please let me know. Any help or pointers are much appreciated!

Edit: ui5.yaml used to run the flpSandbox with it's proxying to ui5.sap.com: (I had to put it as screenshot in order to not fight with the editor here which messed up the syntax highlighting and formatting ...)

Here a version without any "insert Code" (for copy&paste):

# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json
specVersion: "2.5"metadata: name: some.namespace.projecttype: applicationbuilder: customTasks: - name: ui5-task-transpile afterTask: replaceVersion configuration: debug: true removeConsoleStatements: true transpileAsync: trueserver: customMiddleware: - name: ui5-middleware-simpleproxy afterMiddleware: compression mountPath: /resources/openui5 configuration: baseUri: "https://localhost:8080/resources" - name: fiori-tools-appreload afterMiddleware: compression configuration: port: 35729 path: webapp delay: 300 - name: fiori-tools-proxy afterMiddleware: ui5-middleware-simpleproxy #compression configuration: ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted ui5: path: - /resources - /test-resources url: https://ui5.sap.com directLoad: true # performance - name: fiori-tools-preview afterMiddleware: fiori-tools-appreload configuration: component: some.namespace.project ui5Theme: sap_fiori_3 # also tried adding libs as mentioned here: https://www.npmjs.com/package/@sap/ux-ui5-tooling#4-preview

View Entire Topic

Hello marcobeier ,

please check this guide on how to add a local library to your project:

https://help.sap.com/docs/SAP_FIORI_tools/17d50220bcd848aa854c9c182d65b699/6e99fbb264eb4911a8e01ae58...

Hope this helps!

Best regards,

Zdravko