Cweili / svelte-fa

Tiny FontAwesome component for Svelte

Home Page:https://cweili.github.io/svelte-fa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work inside of custom web components

chewbakartik opened this issue · comments

First I want to say great work on this library. It's exactly what I've been looking for, and I love the way that you've exposed the ability to create themes that can be used on multiple icons. I've been struggling with the usage of the component though, when I attempt to add it to a custom web component, rather than just having everything working inside of a normal single page application. The error message that I get is TypeError: Illegal constructor

After a lot of trial and error, and unproductive searching online, I came up with a way that this will work being used inside custom web components that might be a good idea to add in your docs or FAQ. Rather than writing in your script import Fa from 'svelte-fa'; it needs to be import Fa from 'svelte-fa/dist/svelte-fa';. Someone who's using this inside of a custom web component needs to reference the compiled js or they're going to run into the Illegal constructor error.

Thanks for the report.