lustre-labs / lustre

A Gleam web framework for building HTML templates, single page applications, and real-time server components.
https://hexdocs.pm/lustre
MIT License
1.21k stars 78 forks source link

`lustre-server-component.mjs` throws #213

Closed ofekd closed 1 day ago

ofekd commented 4 days ago

The error is:

(index):22 Uncaught NotSupportedError: Failed to execute 'define' on 'CustomElementRegistry': the name "lustre-fragment" has already been used with this registry

Currently wrapping the following code in a try..catch as a workaround:

  window.customElements.define(
    "lustre-fragment",
    class LustreFragment extends HTMLElement {
      constructor() {
        super();
      }
    }
  );
hayleigh-dot-dev commented 1 day ago

Thank you for reporting this, closing as it will be fixed next release.