nuxt / icon

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

@nuxt/icon not working in histoire with mode "svg" #212

Open awacode21 opened 3 months ago

awacode21 commented 3 months ago

I added @nuxt/icon to my project. In the project it is working fine but in histoire it is not working. In histoire it is not able to render the stories that contain components that use @nuxt/icon.

On devtools console you always see the error:

Bildschirmfoto 2024-07-22 um 21 10 24

it doesn't matter if mode is css or svg, it doesn't matter if from iconify icon libs, global components or custom collections, it is simple not able to work with it. The error is always the same.

Here is a reproduction: https://stackblitz.com/edit/nuxt-starter-kckxy8 run the histoire to see the story not getting rendered and the console error in devtools.

Please help!

awacode21 commented 3 months ago

Another user confirmed here: https://github.com/histoire-dev/histoire/issues/746#issuecomment-2253783496 that it is broken since @nuxt/icon version 1.0.0

nuxt-icon@0.6.10 is the last version which was working in histoire. So i guess it is a bug that came up with the refactor

awacode21 commented 3 months ago

@antfu this is NOT fixed for mode="svg" .. the linked merged fix only fixes it for the css version but when using mode svg it is still not working. Please reopen the issue as not fixed.

zzy-life commented 3 months ago

I also encountered a similar problem. I can only use it normally by specifying mode="svg", but this is not a fundamental solution.