SpinnerCircularFixed does not exist?
I had an issue with SpinnerCircularFixed before but I'm having an even weirder one now. My build is saying it doesn't even exist.
The requested module 'spinners-react' does not provide an export named 'SpinnerCircularFixed'
I put together a demo here of a basic Astro project, installed this package and used it. You can see the error. https://github.com/mattfelten/test-spinners
I'm really not sure why since I see the package in node_modules and have looked through the files there. Not sure if this is an issue with Astro/Vite or somethings odd here, so figured I'd share.
This might be an issue with Astro or Vite, so I posted this issue there as well https://github.com/withastro/astro/issues/13066
Please, check this workaround out.
Updating astro.config.mjs to this:
import { defineConfig } from "astro/config";
// https://astro.build/config
export default defineConfig({
vite: {
ssr: {
noExternal: ["spinners-react"],
},
},
});
seems to fix the issue.
Note that since you're using server-side rendering you'd need to inject styles manually:
---
...
import { SpinnerCircularFixed } from 'spinners-react';
import 'spinners-react/lib/index.css';
---
<Layout>
<SpinnerCircularFixed />
<Welcome />
</Layout>