Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"icon.clientBundle.icons" option not fetching icons #245

Open
ptdev opened this issue Aug 27, 2024 · 3 comments
Open

"icon.clientBundle.icons" option not fetching icons #245

ptdev opened this issue Aug 27, 2024 · 3 comments

Comments

@ptdev
Copy link

ptdev commented Aug 27, 2024

Hi,

Just updated to latest version and was trying out the new icon.clientBundle.icons property but apparently the icons are not getting fetched.

We get the following issue when running "yarn dev -o" or "yarn build":

WARN  Nuxt Icon could not fetch the icon data for client bundle:                                     
 - ic:baseline-home
 - fluent-emoji-high-contrast:minibus
 - game-icons:hiking
 - healthicons:4x4
 - mdi:sail-boat
 - mdi:bus-double-decker
 - material-symbols:paragliding-rounded

Reproduction link:

https://stackblitz.com/edit/nuxt-starter-rhvysv?file=nuxt.config.ts

Thank you, cheers!

@antfu
Copy link
Member

antfu commented Aug 27, 2024

Yeah, it doesn't do the network fetch. I agree we should improve the message to guide users to install packages @iconify-json/*

@ptdev
Copy link
Author

ptdev commented Aug 28, 2024

Yeah, it doesn't do the network fetch. I agree we should improve the message to guide users to install packages @iconify-json/*

Do we really need to add those packages manually, even with the new "scan" option?

We were trying to avoid having to install those packages since we only use some icons and they greatly increase the bundle size.
So we had those most used icons hardcoded on "clientBundle.icons" and also have the "clientBundle.scan" option enabled.

From the docs we assumed that this would add the hardcoded icons and then scan the rest of the app for the other icons it finds and therefore include only the icons that are actually used (?)

Cheers

@antfu
Copy link
Member

antfu commented Sep 3, 2024

Yes you need to install them for the build process to get the data. If you don't want to bundle them in the server, you can set serverBundle: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ptdev @antfu and others