#React icons not working
7 messages · Page 1 of 1 (latest)
Hi @limber blaze. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Hmm, I don't know enough to give you a confident answer yet. However, based on the information provided, it seems like you're having an issue with named exports in a CommonJS module.
Astro uses ES Modules (ESM), and the error message suggests that the module you're trying to import from is a CommonJS module. The error message also provides a potential solution: instead of using named imports, you could try importing the entire module and then destructure the named export from the imported module, like this:
import pkg from 'react-icons/md/index.esm.js';
const { MdSwapHorizontalCircle } = pkg;
If this doesn't solve your problem, you might want to check out the Astro documentation (https://docs.astro.build) or ask for help in the Astro Discord community (https://astro.build/chat).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@limber blaze kapa.ai is still learning and improving, please let us know how it did by reacting below
@dreamy lodge solution #1128612053117046835 message
Let me check the knowledge base for you. One moment! :books: