natemoo-re / astro-icon

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

Type generation during `astro check` doesn't include local collection #126

Open charlie-hadden opened 1 year ago

charlie-hadden commented 1 year ago

This is another one on v1. It seems that the type generation that runs during astro check doesn't include local collections. In my case I'm only using a local collection, so that means the icon type gets gets generated as export type Icon = never;. For now I've removed the /// <reference path="../.astro/icon.d.ts" /> but that obviously also means removing some type-safety. I'm afraid I'm not familiar enough with vite plugins to be able to submit a PR for this, but if a reproduction would be helpful then I can put something together for that.

Thanks

stramel commented 12 months ago

Thank you for filing this issue! It seems like this is a regression in the type generation. I will get a fix in for this! If you can submit a reproduction that would be awesome! I was able to run locally and not have issues. I did have to reload my vscode window though.

charlie-hadden commented 12 months ago

Sure thing - I'll get a reproduction put together for you shortly.

charlie-hadden commented 12 months ago

I've put together a small reproduction of this issue here: https://github.com/charlie-hadden/astro-icon-reproduction