hejsfj
hejsfj14mo ago

FontAwesome Import into island component not working as expected

Hey, I want to use FontAwesome with a Fresh component inside my island folder. I followed the following FontAwesome setup: https://fontawesome.com/docs/web/use-with/react/ I'm using Babel Macros for the setup as explained here: https://fontawesome.com/docs/web/use-with/react/add-icons Inside my component.tsx: import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { icon } from '@fortawesome/fontawesome-svg-core/import.macro' <FontAwesomeIcon icon={icon({name: 'coffee', style: 'solid'})} /> When running the code I get the following error message and I'm not quite sure why this happens. error: Uncaught (in promise) SyntaxError: The requested module '@fortawesome/fontawesome-svg-core/import.macro' does not provide an export named 'icon' at file:///Users/hejsfj/GitHub/HEJSFJ/islands/Project.tsx:2:10
Set Up with React
The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome.
Add Icons with React
The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome.
3 Replies
marvinh.
marvinh.14mo ago
Fresh doesn't use Babel under the hood which is why Babel Macros won't work
Kojo.gg
Kojo.gg14mo ago
Are you the person who’s been hired by The Deno Company to develop Fresh?
marvinh.
marvinh.14mo ago
yes