Skip to content

Error on invalid tag names #12925

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

Closed
Rich-Harris opened this issue Aug 20, 2024 · 0 comments · Fixed by #13057
Closed

Error on invalid tag names #12925

Rich-Harris opened this issue Aug 20, 2024 · 0 comments · Fixed by #13057
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the problem

As of #12821, we error on invalid component names. We don't have any similar validation for element names.

In Svelte 4, something like <yes[no]> is a runtime error, because you can't do this:

document.createElement('yes[no]');

Because we use template cloning in Svelte 5, we don't hit that constraint — it just lets you create an obviously-incorrect element. We should have some validation here

Describe the proposed solution

Either replace the 'invalid component name' error with a more generic 'invalid tag name' error, or have some way of determining whether a tag name is supposed to be a component or an element before we've been able to determine whether it's valid

Importance

nice to have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant