New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails when using a React component with react-icons within an astro file #7629
Comments
The I'm not sure this is an Astro issue; the problem is clearly the package. @bluwy do you know if there's a way, via Astro config, to bypass the issue? |
Closing this issue since it's upstream. Unfortunately, we can't make every outdated package work with Astro out of the box.
|
Sorry forgot to reply to this. A way would be to follow the syntax as suggested by the error message. Or another way is to configure |
Worked for me! The import { defineConfig } from "astro/config";
// https://astro.build/config
export default defineConfig({
...,
vite: {
ssr: {
noExternal: ["react-icons"],
},
},
}); |
its working. thank you 🤩 |
What version of
astro
are you using?2.8.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Windows, Mac
What browser are you using?
Chrome
Describe the Bug
When using
react-icons
(4.10.1) within a React component that is referenced in an Astro file and the build script is run vianpm run build
the build fails with the following error:Running the project using
npm run dev
works fine and the icons render as expected.What's the expected result?
The app and all corresponding assets are built successfully as expected.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-z3zm9g?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: