Skip to content

fix(docs): fix custom element registry conflicts by renaming list-components with unique names #5356

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alionazherdetska
Copy link
Contributor

📄 Description

Fixed rendering issue in the Getting Started category by solving component name conflicts between Designer and Developer pages.

The issue was caused by identical custom element names ("list-component") being registered twice in the Storybook environment, resulting in the error: "Failed to execute 'define' on 'CustomElementRegistry': the name 'list-component' has already been used with this registry".

The solution:

  • Created unique component names for each page ("designer-list-component" and "developer-list-component")

🚀 Demo

If applicable, please add a screenshot or video to illustrate the changes.


📝 Checklist

  • ✅ My code follows the style guidelines of this project
  • 🛠️ I have performed a self-review of my own code
  • 📄 I have made corresponding changes to the documentation
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✔️ New and existing unit tests pass locally with my changes

@alionazherdetska alionazherdetska requested review from a team as code owners April 28, 2025 13:21
Copy link

changeset-bot bot commented Apr 28, 2025

🦋 Changeset detected

Latest commit: 556279c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@swisspost/design-system-documentation Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Apr 28, 2025

Related Previews

@@ -22,8 +22,8 @@ interface IndexInput {
};
}

@customElement('list-component')
export class ListComponent extends LitElement {
@customElement('designer-list-component')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still calling list-component in the developer.docs.mdx and designer.docs.mdx files, shouldn't it be updated there as well?

@github-project-automation github-project-automation bot moved this from 👀 Triage to 🧐 In Review in Design System Production Board Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧐 In Review
Development

Successfully merging this pull request may close these issues.

3 participants