#Using simple-icons-astro

8 messages · Page 1 of 1 (latest)

silent vale
#

8:31:17 AM [vite] (ssr) Error when evaluating SSR module /Users/eveeifyeve/github/TeaClientMC/Website/astro.config.ts: 2 errors building "/Users/eveeifyeve/github/TeaClientMC/Website/node_modules/simple-icons-astro/dist/I1001tracklists.astro"
at requestFetch (native:1:11)
at <anonymous> (native:11:43)
at <anonymous> (native:11:37)
at requestInstantiate (native:1:11)
at requestSatisfyUtil (native:1:11)
at <anonymous> (native:11:83)
at processTicksAndRejections (native:7:39)
[astro] Unable to load your Astro config

Expected "(" but found "Layout"
Stack trace:
at requestFetch (native:1:11)
at <anonymous> (native:11:37)
at requestSatisfyUtil (native:1:11)
at processTicksAndRejections (native:7:39)
error: script "dev" exited with code 1

gilded finchBOT
#

Hi @silent vale. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

It looks like Vite/Astro is failing to SSR-evaluate a component from simple-icons-astro while loading your astro.config, causing “Unable to load your Astro config” and a parse error. This typically happens when importing framework components or packages that need SSR handling during config load, or when a dependency isn’t bundled correctly for SSR.

Try these steps:

  • Ensure the renderer/integration matches the component type you’re importing. If the package exports React/Vue/Svelte components, you must have the corresponding Astro integration installed; otherwise you’ll get “no matching renderer” style failures when SSR tries to parse the file (e.g., add @astrojs/react for React components) (No matching renderer).
  • Add the package to vite.ssr.noExternal so Astro can bundle it for SSR. This is required for some npm packages to be prerendered/SSR’d correctly from your project/config:
    astro.config.mjs/ts:
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      vite: {
        ssr: {
          noExternal: ['simple-icons-astro'],
        },
      },
    });
    
    (Importing styles or packages without explicit extensions often requires this; the same mechanism applies to packages in monorepos or external dependencies that must be bundled for SSR) (External styles: import from an npm package, Monorepo dependencies).
#
  • If you’re on Astro v5 and your astro.config imports any locally linked JS dependencies (e.g., a local integration), note that config-time dependencies are no longer processed by Vite. Build those dependencies first so Node can import them directly (Astro v5 change).

If the error persists and specifically points to parsing a .astro file inside the package (“Expected '(' but found 'Layout'”), that indicates Astro couldn’t import the module at all. Double‑check the import path and that the package version exports valid .astro files compatible with your Astro version, and treat it as a FailedToLoadModuleSSR scenario (FailedToLoadModuleSSR).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@silent vale Kapa.ai is still learning and improving, please let me know how I did by reacting below.

silent vale
#

@gilded finch Well it's in config

gilded finchBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

If you’re importing simple-icons-astro (or anything that ships .astro files) from your astro.config, Astro must be able to SSR-bundle that dependency at config load. Add it to vite.ssr.noExternal in your config:

// astro.config.ts
import { defineConfig } from 'astro/config';

export default defineConfig({
  vite: {
    ssr: {
      noExternal: ['simple-icons-astro'],
    },
  },
});

This is the same mechanism Astro recommends when an npm package needs bundling for SSR/prerender (e.g. stylesheet or monorepo cases) so it can be evaluated during server build/config time (External styles: npm package, Monorepo deps).

If Astro still can’t import it and you see parse errors like “Expected '(' but found 'Layout'” originating from the package’s .astro file, treat it as a FailedToLoadModuleSSR issue (bad path or incompatible module) and verify the package export you’re importing is valid for your Astro version (Could not import file).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: