natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
996 stars 57 forks source link

Page doesn't load when using astro-icons with ssr #77

Closed PringlePot closed 1 year ago

PringlePot commented 1 year ago

After some trying, it seems like using the @astrojs/node build output does not work with astro-icon. It causes the page to be stuck at loading when in a production build. It does work in normal yarn dev mode tho. There are no errors in the console while building or running the code with yarn preview which makes it hard to debug the issue and find the root of the problem

aaronteamAAR commented 1 year ago

After some trying, it seems like using the @astrojs/node build output does not work with astro-icon. It causes the page to be stuck at loading when in a production build. It does work in normal yarn dev mode tho. There are no errors in the console while building or running the code with yarn preview which makes it hard to debug the issue and find the root of the problem

So do suggest using yarn over npm while using astro-icon ?

stramel commented 1 year ago

There is a known limitation with SSR currently when using this plugin. See #35. Please feel free to provide more information if you're running into a different issue than the existing SSR limitations.

PringlePot commented 1 year ago

The issue is, I'm using nodejs to host the server, so svgo should work right?