D
Deno

help

FontAwesome Import into island component not working as expected

Hhejsfj10/27/2023
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.
Mmarvinh.10/27/2023
Fresh doesn't use Babel under the hood which is why Babel Macros won't work
Eeric.uhd10/28/2023
Are you the person who’s been hired by The Deno Company to develop Fresh?
Mmarvinh.10/28/2023
yes

Looking for more? Join the community!