SAP / open-ux-tools

Enable community collaboration to jointly promote and facilitate best in class tooling capabilities
Apache License 2.0
83 stars 39 forks source link

BUG - preview middleware served launchpad not able to navigate to (fiori elements) application in UI5 122.x #1841

Closed heimwege closed 5 months ago

heimwege commented 6 months ago

Hey hey πŸ‘‹πŸ»

In UI5 >=1.122.x the launchpad served by the preview middleware is no longer able to open a Fiori Elements app.

Details see internal incident DINC0116030

Seems like NavTargetResolution is now required 🀷🏻

Expected results

App opens on click of tile

Actual results

Error message:

App could not be opened because the SAP UI5 component of the application could not be loaded.
Failed to load UI5 component for navigation intent "#Samples-display"

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

zdravko-georgiev commented 6 months ago

@heimwege I am still able to successfully run a Fiori elements application locally without having the NavTargetResolution. Are you able to reproduce the issue locally?

heimwege commented 6 months ago

@zdravko-georgiev my CAP Java FE playground repo worked in 1.120.11 and didn't work once I upgraded to 1.122.2. So basically as described in the internal incident. The solution as also taken from there.

zdravko-georgiev commented 6 months ago

@heimwege I can reproduce it with your CAP Java FE playground repo. This is a very interesting issue, because if I switch the loading of UI5, hence use the ui5-proxy-middleware and load UI5 from ui5.sap.com and NOT from npmjs, then the issue does not occur.

heimwege commented 6 months ago

I tried the same and yes, the navigation as such works when using the proxy which is strange enough, but the application seems to be broken too. I get the following FE error that I don't get with the implemented fix and the sources are served directly without the proxy:

image

This is indeed really strange as it seems the served UI5 sources are not identical πŸ€”

zdravko-georgiev commented 6 months ago

I tried the same and yes, the navigation as such works when using the proxy which is strange enough, but the application seems to be broken too. I get the following FE error that I don't get with the implemented fix and the sources are served directly without the proxy:

image

This is indeed really strange as it seems the served UI5 sources are not identical πŸ€”

Please try Empty Cache and Hard Reload in the browser tab. Sometimes there are cache issue when switching between npmjs and ui5.sap.com versions

heimwege commented 6 months ago

That solved it, thanks. I thought I'm on the safe side if I just use sap-ui-xx-viewCache=false. Seems not to be the case πŸ™ˆ

zdravko-georgiev commented 6 months ago

That solved it, thanks. I thought I'm on the safe side if I just use sap-ui-xx-viewCache=false. Seems not to be the case πŸ™ˆ

This one only disables the cache for the XML Views πŸ˜‰

tobiasqueck commented 5 months ago

@heimwege, the issue can be closed correct? If not, and I misunderstood, please reopen.

heimwege commented 5 months ago

@tobiasqueck fine for me, but as there will be no downport closing this issue means preview middleware is broken for >= 1.122.x < 1.124.x (wrt the generated FLP part). So at least the readme should be adjusted accordingly. @zdravko-georgiev please correct me if I'm wrong.

tobiasqueck commented 5 months ago

Maybe I misread the discussion, however, I thought to understand that it is an issue in UI5 independent of the middleware i.e. if you create a local flp.html file and do the same, you run into the same issue.

heimwege commented 5 months ago

Depends on how your local flp configuration looks like πŸ˜„ Assuming you use the very same config for the flp sandbox the preview middleware uses in its flp template, my understanding is that you will run into exactly the same issue (in case you use the ui5 sources from npmjs! Using the proxy to load the ui5 sources works πŸ™ˆ). So even if this issue is not a preview middleware issue, there's a broken flp sandbox config in 1.122.x and 1.123.x that leads to a broken flp in the preview middleware. So either the UI5 colleagues do a downport of the fix (which they declined) or we should at least add this information to the readme of the preview middleware. That's why I re-opened the issue that adjusting the readme is not forgotten.

tobiasqueck commented 5 months ago

Ok, now I am getting it. We usually recommend to use the ui5-proxy-middleware (standalone or included in the `@sap/ux-ui5-tooling), and as far as I understand, then you won't have the issue. So, we are talking about a corner case here.

I am a little reluctant to add this to the README because it could create the impression that all known issue with the other packages are listed, which we don't. Since these are no long term release versions of UI5, I'd still prefer not doing anything here.

What do you think?

heimwege commented 5 months ago

Fine for me πŸ‘πŸ» Will close the issue.