ui5-ecosystem-showcase icon indicating copy to clipboard operation
ui5-ecosystem-showcase copied to clipboard

[cds-plugin-ui5] - hybrid testin in sap bas

Open T0bbes opened this issue 1 year ago • 5 comments

Hi all,

I have a SAP CAP project with a few CAP services and a few custom UI5/Fiori apps. Deployed everything works fine. Now I wanted to try these UI5 apps "locally" in SAP BAS.

After a few hours I have to give up and hope that you can help me. The project has the classic structure, so the services are in the srv directory and the WebApps are in the app/App1/ directory. In my root packge.json I have added the plugin cds-plugin-ui5 and I start my cds server with cds watch --profile hybrid.

At the moment I have the following UI5.yaml configuration:

specVersion: "3.2"
metadata:
  name: XYZ
type: application
server:
  customMiddleware:
    - name: fiori-tools-servestatic
      afterMiddleware: compression
      configuration:
        paths:
        - path: /YYY
          src: "../../../lib..."
    - name: fiori-tools-proxy
      afterMiddleware: compression
      configuration:
        ignoreCertError: false 
        backend:
          - path: /odata/v2
            url: http://localhost:4004
          - path: /resources
            url: https://ui5.sap.com
          - path: /test-resources
            url: https://ui5.sap.com
          - path: /sap
            url: http://XYZ.de:443
            client: '010'
            destination: XYZ

All OData services, both my local cap services as well as the on-premise odata interfaces are successfully accessed. The metadata is loaded successfully and I can see data.

The only problem is that the Component-preload.js could not be found. Everything could be loaded, expect this one file.

I can change the UI5.yaml a little bit, then the file is found again, but then the OData interfaces could no longer be found. What am I missing? Can anyone of you help me? Unfortunately I can't find a complete cap example that shows hybrid testing with ui5 in SAP BAS :( At the moment I can only load one or the other.

Thank you very much!

T0bbes avatar May 07 '24 17:05 T0bbes

@T0bbes normally the component preload is not available in the local development scenario. did you serve it with the servestatic middleware from the dist folder or from where did you serve the component preload?

petermuessig avatar May 07 '24 21:05 petermuessig

@petermuessig I do not provide it. It's generated automatically. Do I need to disable this generating for local running?

T0bbes avatar May 08 '24 06:05 T0bbes

@T0bbes but the preload is created during the build and not when using the dev server. That's what I mean. Do you serve the built app from the dist folder?

petermuessig avatar May 08 '24 07:05 petermuessig

@petermuessig I just using cds watch --profile hybrid (after the binding of the services etc.) which will open the overview with the services and embedded ui5 applications and then I will use one of these ui5 apps.

T0bbes avatar May 08 '24 08:05 T0bbes

@T0bbes - is there an easy way to reproduce your issue? or checking your project? if you are SAP internal and the repo as well, you may also reach out to me internally.

petermuessig avatar May 10 '24 14:05 petermuessig

No way to reproduce - closing it

petermuessig avatar Oct 11 '24 06:10 petermuessig