Skip to content

v13 - UUI no longer exported to be used by packages #15397

@lauraneto

Description

@lauraneto

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

  1. Open the dev console in an Umbraco 13 installation
  2. Verify that window.uui is undefined
  3. Open the dev console in an Umbraco 12 installation
  4. Verify that window.uui is defined

Expected result / actual result

No response


This item has been added to our backlog AB#35880

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions