nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.
https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue
MIT License
864 stars 37 forks source link

Component does not fall back to Iconify API when using client-side rendering #179

Open JakeIsMeh opened 5 days ago

JakeIsMeh commented 5 days ago

SSR works as the icons show up on initial load.
Also tested with ssr: false.

Repro: https://github.com/JakeIsMeh/nuxt-icon-static-repro

https://github.com/nuxt/icon/assets/33054273/d3855208-8ecb-4433-a754-2e271a2c1dab

garyo commented 1 day ago

I may be seeing this same thing. My uil icons show up fine in dev mode but in the generated static site, the api calls return 404.

 HTTP  2024-6-30 6:21:37 PM ::1 GET /api/_nuxt_icon/uil.json?icons=moon%2Csun
 HTTP  2024-6-30 6:21:37 PM ::1 Returned 404 in 4 ms

This makes sense (?) because there is no local API server at all (it's a static site), and the .output/public dir does not contain a _nuxt_icon subdir.