Component does not fall back to Iconify API when using client-side rendering
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
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.
I have the same (or similar) issue. On first load, the icons show up on the page I visit, but if I navigate to another page on my app, I get a 404. If I refresh this page, the icons show up and the 404 is not thrown. Navigating to other pages repeats this behaviour consistently. Strange behaviour.
GET /api/_nuxt_icon/mdi.json?icons=alert-decagram%2Carrow-left-circle-outline%2Ccalculator-variant%2Crobot-excited-outline%2Cvideo-input-antenna 404 (Not Found)
Running nuxt 3.12.3 and @nuxt/icon 1.0.0
I have the same problem
Me too
Same situation
Same problem
The fix in de92533 did not actually fix it for me, since I'm generating a static site (nuxt generate). I still had to manually preload all the icons I wanted. But using the idea from the fix, I added this to my nuxt.config.ts and that does seem to fix it:
icon: {
provider: 'iconify'
},