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

SvelteKit/Vite Not Working

michaelusantiago opened this issue · comments

I read, followed and tried the instruction on the documentations.
1.) this example works on development mode: - Note (SvelteKit/Vite)
import Fa from 'svelte-fa' import { faFlag } from '@fortawesome/free-solid-svg-icons'
but will failed on build

2.) this example cause errors on development and will not compile:
import Fa from 'svelte-fa/src/fa.svelte' import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons/index.es'
even with app.d.ts set to:
declare module '@fortawesome/free-solid-svg-icons/index.es' { export * from '@fortawesome/free-solid-svg-icons'; }

I'm stuck on this, the project works in dev but breaks on build
I think it's a problem with FontAwesome

I'm stuck on this, the project works in dev but breaks on build I think it's a problem with FontAwesome

@tallestlegacy I solved mine already sveltejs/kit#4454 look at my comment at the bottom

@michaelusantiago @tallestlegacy Glad to see FontAwesome mention that they are willing to fix this issue in the next upcoming release. Thank you for the solution to this issue.

I'm stuck on this, the project works in dev but breaks on build I think it's a problem with FontAwesome

@tallestlegacy I solved mine already sveltejs/kit#4454 look at my comment at the bottom

@michaelusantiago Thanks for linking to the issue, what worked for me was simply using the named imports for the specific module such as : import { faEnvelope } from "@fortawesome/free-solid-svg-icons/faEnvelope"; as suggested by Rich Harris! I did not need to edit the vite.config.js file

commented

FontAwesome has got this fixed and tested and ship with 6.2.0.