-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.0.0-rc4
Bug summary
I was trying to update a package that uses the uui library to v13 and am getting this error on the console:
Uncaught ReferenceError: uui is not defined.
In v13, due to the new login screen changes, the uui library is no longer being exported to the window object.
This is because it is now being included as part of the login es module, as its own chunk.
Due to the way Umbraco loads package dependencies, we are forced to use IIEF, and can't use an ES module.
(afaik, please let me know if this is not the case)
This used to work perfectly fine in v12 with @umbraco/uui set as external, as the dependency was resolved from the window object as uui.
As a workaround I tried to not set uui as external.
While not ideal, because we would be loading duplicate code, I thought it might be worth a shot.
But that also didn't work, and triggered other issues. Example:
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "uui-modal-sidebar" has already been used with this registry
The problem is caused by the fact that the code is now duplicated and due to a bug in the UUI library itself, as it is using customElement instead of the umbraco custom defineElement decorator that ensures elements are only registered once.
This means that packages that use the uui library and define their own custom elements are effectively broken in v13.
Specifics
No response
Steps to reproduce
- Open the dev console in an Umbraco 13 installation
- Verify that
window.uuiisundefined - Open the dev console in an Umbraco 12 installation
- Verify that
window.uuiis defined
Expected result / actual result
No response
This item has been added to our backlog AB#35880