Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with multiple component registration if multiple libraries import this lib #71

Open
spwoodcock opened this issue Feb 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@spwoodcock
Copy link
Member

Describe the bug

  • In DroneTM we import hotosm/ui for the tracking banner.
  • DroneTM also uses the hotosm/gcp-editor component, which uses hotosm/ui underneath.
  • We get an error that the components are imported twice.

Image

Expected behavior

  • The imports are conditional, only if the element name does not exist in the custom element registry already?
  • Perhaps something like this?
if (!customElements.get('hot-tracking')) {
  customElements.register(...)
}

Additional context

  • Or perhaps this is just due to incorrect usage of the lib?
  • gcp-editor imports all the components as a bundle.
  • For packages that may be installed, they should probably selectively import components?
@spwoodcock spwoodcock added the bug Something isn't working label Feb 3, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Shared UI Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant