SAP/ui5-tooling

Failed to load reuse component with 3.0

marianfoo opened this issue · 3 comments

Expected Behavior

Start a app and load a library with componentUsages and resourceRoots

Current Behavior

App does not find component
image
When changing to cli 2.14.17 it works. With 3.0.1 it does not.
Any breaking changes here? Only difference is the version change.
see here for the apps ´manifest.json´

Please check if you can reproduce the error or i might have missed something in the steps

Steps to Reproduce the Issue

  1. git clone https://github.com/marianfoo/ui5-cc-excelUpload
  2. git checkout chore/update-dependencies
  3. pnpm i
  4. npm run build
  5. npm run start:server
  6. npm run start:v4fe:108
  7. Press "Excel Upload" Button (List Report, right upper corner) --> nothing happens, 404 Error not found in console
  8. Stop UI5 App
  9. Change to UI5 CLI 2.14.17 here --> https://github.com/marianfoo/ui5-cc-excelUpload/blob/6125af1bcb96e9b29ad76434e267b6fa01a588da/examples/packages/ordersv4fe/package.json#L19
  10. pnpm i
  11. npm run start:v4fe:108
  12. Press "Excel Upload" Button --> Dialog appears

image

Context

  • Node.js Version: 18.14.0
  • npm Version: unknown
  • OS/Platform: mac
  • Browser (if relevant): chrome
  • Other information regarding your environment (optional): nothing

Thanks for reporting! This is indeed caused by an involuntarily breaking change.

Essentially, shims contained in the same module as a project won't be applied to that project anymore.

In your project, you have the following ui5.yaml configuration for module ui5-cc-excelupload:

specVersion: "2.6"
type: module
metadata:
  name: ui5-cc-excelupload
---
specVersion: "2.6"
kind: extension
type: project-shim
metadata:
  name: thirdparty
shims:
  configurations:
    ui5-cc-excelupload:
      specVersion: "2.6"
      type: module
      metadata:
        name: ui5-cc-excelupload
      resources:
        configuration:
          paths:
            "/thirdparty/customControl/excelUpload/v0/8/1/": "./dist/"

This is a project ui5-cc-excelupload and an extension thirdparty, containing a configuration for the project.

With UI5 Tooling v2, the shim used to be applied to the already created project.

In UI5 Tooling v3, there are two relevant changes:

  1. Shims can only be applied during the creation of a project
  2. The project and extensions of a module are created at the same time

So the behavior you are observing is by design. You can resolve this by moving the configuration from the shim to the module itself, like this:

specVersion: "2.6"
type: module
metadata:
  name: ui5-cc-excelupload
resources:
  configuration:
    paths:
      "/thirdparty/customControl/excelUpload/v0/8/1/": "./dist/"

To better understand your scenario, could you share some details on why you chose to configure the project via the shim extension?

Thanks for your help.
With the other yaml it works.

To better understand your scenario, could you share some details on why you chose to configure the project via the shim extension?

Honestly because I just did not know better and with v2 it worked 😄

Alright 😄 👍