rough-stuff / wired-elements

Collection of custom elements that appear hand drawn. Great for wireframes or a fun look.
https://wiredjs.com
MIT License
10.5k stars 329 forks source link

Tabs not working when importing top-level #189

Open kasbah opened 1 year ago

kasbah commented 1 year ago

Previous issues with tabs: #146 , #99 . Tabs are not working for me when imported from top-level.

https://codesandbox.io/s/wired-elements-vanilla-forked-bg4qiw?file=/index.html

Uncaught DOMException: CustomElementRegistry.define: 'wired-item' has already been defined as a custom element custom-element.js:6
    e https://unpkg.com/@lit/reactive-element@^1.6.0/decorators/custom-element.js?module:6
    e https://unpkg.com/@lit/reactive-element@^1.6.0/decorators/custom-element.js?module:6
    __decorate https://unpkg.com/wired-elements@3.0.0-rc.6/lib/wired-item.js?module:4
    <anonymous> https://unpkg.com/wired-elements@3.0.0-rc.6/lib/wired-item.js?module:125

If I instead use specific modules:

  <script
    type="module"
    src="https://unpkg.com/wired-elements/lib/wired-tabs.js?module"
  ></script>
  <script
    type="module"
    src="https://unpkg.com/wired-elements/lib/wired-tab.js?module"
  ></script>

Then I encounter #179 but otherwise it seems to be working ok.