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

Svelte plugin 'Tag' warning. #162

Closed
RikuVan opened this issue Nov 21, 2020 · 4 comments · Fixed by #163
Closed

Svelte plugin 'Tag' warning. #162

RikuVan opened this issue Nov 21, 2020 · 4 comments · Fixed by #163

Comments

@RikuVan
Copy link
Contributor

RikuVan commented Nov 21, 2020

Updated to the latest attractions version and now I am getting a warning fo each component:
(!) Plugin svelte: The 'tag' option is used when generating a custom element. Did you forget the 'customElement: true' compile option?

I do not need this option. Do you know if there is a way to suppress the warning? Maybe something should be added to the documentation about this.

@illright
Copy link
Owner

Yeah, we've seen the warning. No way that I have seen so far to suppress this warning, wanted to reach out to Svelte developers about it, haven't gotten around to it yet.

@aabounegm
Copy link
Collaborator

We are using this option to compile a Web Components version of the library for easy use with other (or no) frameworks. However, we did not yet figure out how to disable that warning when using them with Svelte but without customElement, since for Svelte the component is imported from its source code and not the compiled version. Since this is arguably the most common use-case, we are thinking of ditching customElements altogether, but that would not be so great.
Ideally, the <svelte:options tag={}> part should be used only when compiling, and removed when importing directly. I looked through the documentation, StackOverflow, and GitHub issues, but couldn't figure it out. Do you have an idea how to do that?

@RikuVan
Copy link
Contributor Author

RikuVan commented Nov 21, 2020

No, I looked around a bit and didn't find anything. One option would be to remove the tag and then have a separate web components build that uses a script to insert the <svelte:options tag={}> in each file. Might be worth looking at how some other Svelte libraries achieve this, or ask about it in their Discord.

@aabounegm
Copy link
Collaborator

Should be fixed now in v2.2.3. Please update and check if the issue persists.

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.

3 participants