ui5-community / ui5-ecosystem-showcase

A repository showcasing the UI5 tooling extensibility to combine OSS tools for UI5 application development.
https://ui5-community.github.io/ui5-ecosystem-showcase/
Other
189 stars 91 forks source link

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

Open T0bbes opened 1 month ago

T0bbes commented 1 month ago

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!

petermuessig commented 1 month ago

@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?

T0bbes commented 1 month ago

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

petermuessig commented 1 month ago

@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?

T0bbes commented 1 month ago

@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.

petermuessig commented 1 month ago

@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.