Skip to content

tag required in customElement options #13161

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
gVguy opened this issue Sep 7, 2024 · 1 comment · Fixed by #13172
Closed

tag required in customElement options #13161

gVguy opened this issue Sep 7, 2024 · 1 comment · Fixed by #13172

Comments

@gVguy
Copy link

gVguy commented Sep 7, 2024

Describe the bug

The docs state

You can leave out the tag name ... Consumers of the component can still name it afterwards if needed, using the static element property ...

However in the actual project when you want to set some other options, eg <svelte:options customElement={{}} /> the tag property is suddenly required.

Setting the tag would disallow the use of the customElements in a selective way as required by the consumer, auto-defining the customElement at import time with a pre-defined tag.

This is currently present in both v4 and v5.

Reproduction

https://svelte.dev/repl/5fb1659f5ea24696ae342144eb492acb?version=4.2.19

Logs

No response

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
    Memory: 1.01 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
    npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
  Browsers:
    Chrome: 128.0.6613.120
    Chrome Canary: 130.0.6701.0
    Safari: 17.4.1
  npmPackages:
    svelte: ^5.0.0-next.244 => 5.0.0-next.244

Severity

blocking all usage of svelte

@gVguy
Copy link
Author

gVguy commented Sep 8, 2024

It appears to be only a type error, for example if we ignore it and run the app, it works as expected, so maybe it’s the matter of making the ‘tag’ key optional in the customElement type

dummdidumm added a commit that referenced this issue Sep 9, 2024
Was missing from #12754 where we made the tag optional

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

Successfully merging a pull request may close this issue.

1 participant