Closed michaelroper closed 6 months ago
Hi @michaelroper 👋
It looks like astro-icon integration depends on a Vite plugin in order to build. When bookshop:generate
tries to build your components for the browser it runs without that plugin, leading to the error you're seeing.
Unfortunately I don't think there are any great ways to get around this in your config. Bookshop will try and load Vite plugins from your config file when building your components, so if you could find a way to pull the Vite plugin out of astro-icon
or write your own plugin that provides a stubbed version of the virtual:astro-icon
import that could, in theory, fix your build but may end up being a lot of work.
Hi again @michaelroper, this issue should be fixed in the latest Bookshop release (3.10.0). Bookshop Astro now looks at your site's integrations and tries to pull out any Vite plugins it finds. This is still relatively experimental so your results might vary integration to integration, but in my testing it did work with astro-icon so you should be able to include it alongside Bookshop without issue!
Thanks @Tate-CC - I'll check it out when i get a chance!
Hey team, I have an Astro site that I am using the astro-icon package to inline some custom SVG icons, and while the site itself builds without a problem, when I try to do
bookshop:generate
, it throws the below error at the end:Does that sound like something I can solve within my site config, even though the error is coming from the dependency itself? I realise this may not be a bookshop-specific issue, but any pointers on how to resolve would be appreciated.