Skip to content

SpinnerCircularFixed does not exist? #34

Open

Description

@mattfelten

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.

Activity

  1. mattfelten commented on Jan 24, 2025

    @mattfelten
    Author

    This might be an issue with Astro or Vite, so I posted this issue there as well withastro/astro#13066

  2. adexin-team commented on Apr 27, 2025

    @adexin-team
    Contributor

    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>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions