This post explains why changes to the adaptation project may not be loaded when pressing on “Preview Application” in Visual Studio Code.
The scenario is as follows:
- Developer gets initial business requirements and creates Adaptation Project for the Fiori app (for example, by creating a Controller Extension)
- Developer tests the app locally, and sees his changes
- Adaptation Project is deployed to the On-Premise S/4HANA SAP system
- Developer gets new business requirements and modifies Adaptation Project
- Developer tests the app locally, but the newest changes are not loaded, only those which were deployed to the system
When the Adaptation Project is generated the custom middleware fiori-tools-proxy, which uses backend-proxy-middleware, is by default configured to proxy all requests starting with /sap to the backend system:
That also includes requests to the Layered Repository (lrep):
This means, that even though the developer launches the Application Preview locally, the Adaptation Project changes are being loaded from the system backend system.
How to fix Adaptation Project changes not being loaded locally?
As the proxy is mainly used to load OData responses and UI5 resources, it can be configured to only load OData responses and UI5 resources from the backend, and skip requests to layered repository, such as /sap/bc/lrep/flex, by configuring two paths:
- /sap/opu/odata
- /sap/bc/ui5_ui5
Above fix results in correct loading of customer extensions from the adaptation project locally.