Fix `TypeError` when trying to use `@converse/headless`

Fixes #2788
This commit is contained in:
JC Brand 2022-02-03 12:39:59 +01:00
parent 0f648ed1eb
commit 337638034f
2 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,7 @@
- #1761: Add a new dark theme based on the [Dracula](https://draculatheme.com/) theme
- #2751: Media not rendered when Converse runs in a browser extension
- #2786: Fix webpack configuration not working on Windows OS
- #2788: `TypeError` when trying to use `@converse/headless`
- #2789: Implement new hook `parseMessageForCommands` for plugins to add custom commands

View File

@ -740,7 +740,9 @@ Object.assign(converse, {
initPlugins(_converse);
// Register all custom elements
api.elements.register();
// XXX: api.elements is defined in the UI part of Converse, outside of @converse/headless.
// This line should probably be moved to the UI code as part of a larger refactoring.
api.elements?.register();
registerGlobalEventHandlers(_converse);