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
192 stars 93 forks source link

ui5-tooling-modules-middleware cannot be found when using fiori-tools-proxy #945

Closed maxmeiderr closed 8 months ago

maxmeiderr commented 9 months ago

Hi!

I am trying to use a npm package in a local dev environment. I saw that ui5-tooling-modules seems to be able to fulfill this use case.

When following the instructions I come across this passage:

⚠️ In case your application is using a proxy such fiori-tools-proxy, the proxy must run after ui5-tooling-modules-middleware middleware. Otherwise proxy will try to serve the resources for your installed npm package instead of ui5-tooling-modules-middleware. You can achieve this by setting afterMiddleware: ui5-tooling-modules-middleware in fiori-tools-proxy middleware.

This applies to me since I am using "fiori-tools-proxy" as a custom middleware. When running the ui5 serve i get following error:

⚠️ Process Failed With Error Error Message: Could not find middleware ui5-tooling-modules-middleware, referenced by custom middleware fiori-tools-proxy

here are the versions of the relevant npm packages: "@sap/ux-ui5-tooling": "^1.12.3", "@ui5/cli": "^3.9.0", "ui5-tooling-modules": "^3.3.4"

Expected behavior I expect the application to start with fiori-tools-proxy running after ui5-tooling-modules-middleware middleware

Many thanks in advance Max

petermuessig commented 9 months ago

Hi @maxmeiderr ,

did you also configure the ui5-tooling-modules-middleware in the ui5.yaml:

server:
  customMiddleware:
    - name: ui5-tooling-modules-middleware
      afterMiddleware: compression
    - name: fiori-tools-proxy
      afterMiddleware: ui5-tooling-modules-middleware

Also the order of the middlewares is important. Please check your ui5.yaml. You may also share it here so that I can take a look if this doesn't solve your issue...

Best regards, Peter

maxmeiderr commented 8 months ago

Hi Peter, I did have "afterMiddleware: ui5-tooling-modules-middleware", but I didn't have the "ui5-tooling-modules-middleware" listed as a seperate middleware. Your comment has clarified my confusion resolved my issue immediately. Thank you!

Best regards Max