SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.55k stars 266 forks source link

[framework]: sap/ui/core/Popup is undefined #8709

Closed JarrettChan closed 4 months ago

JarrettChan commented 7 months ago

Bug Description

When OpenUI5Support is loaded after window.sap.ui.getCore is defined. Sometimes the "OpenUI5Support" is loaded before isOpenUI5Detected(), and then after everything initializes sap.ui.core.Popup is still undefined and subsequent calls to sap.ui.require("sap/ui/core/Popup") also return undefined. This bad state can be recovered by calling OpenUI5Support.init() or sap.ui.requireSync("sap/ui/core/Popup")

We have a function that waits for when sap.ui.getCore is defined to then import OpenUI5Support. Removing this waiting function to always call OpenUI5Support seems to avoid the issue, but this timing issue could occur naturally.

Affected Component

No response

Expected Behaviour

OpenUI5Support shouldn't fatally break when sap.ui.require("sap/ui/core/Popup") is undefined

Isolated Example

No response

Steps to Reproduce

Details in offline slack channel

Log Output, Stack Trace or Screenshots

No response

Priority

Low

UI5 Web Components Version

1.20.0

Browser

Chrome

Operating System

No response

Additional Context

No response

Organization

SuccessFactors

Declaration

vladitasev commented 4 months ago

Hello,

This issue was addressed by the following fix in the 2.0 codeline:

https://github.com/SAP/ui5-webcomponents/pull/8785

In short, icons were triggering the framework lifecycle (boot()) too early just for the sake of exporting the SVG path data (which is never imported by applications anyway)

Technically, this is a breaking change, therefore the fix is for 2.0. If you have a working solution right now, and it is ok for you, we'd prefer not to downport this fix to 1.24.

Please let us know if it's ok for you to consume the fix directly when you update to 2.0 eventually, or you still need a solution in 1.24

Regards, Vladi

JarrettChan commented 4 months ago

We do not need a downport as we did a workaround to avoid this issue.