natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!

Home Page:https://astroicon.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Sprite.Provider/Spritesheet breaks pages where sprites are not used

btk5h opened this issue · comments

Sprite.Provider breaks pages that do not use any sprites.

Steps to reproduce

Create an astro page with a Sprite.Provider but with no Sprite components as children

Observed behavior

The page fails to build with a misleading "<SpriteSheet> should be the very last child of the page's <body>!" error

Desired behavior

The page builds and renders properly

Workaround

Don't render the Sprite.Provider on pages (which may be difficult if placed in a layout component), or add a hidden sprite to each page

Ah this is a good point, I think I can remove this behavior now. This was mostly to catch issues when migrating.

Fixed this in 3b29d89 and released in astro-icon@0.7.0!