jcamp-code / nuxt-icon-tw

The <Icon> component, supporting Tailwind CSS Icons, Iconify, Emojis and custom JSON files.
MIT License
1 stars 1 forks source link

Nuxt Tailwind Icon from preset not showing #3

Open frasza opened 7 months ago

frasza commented 7 months ago

Hey,

I found package since Nuxt Icon only provides option for icons to be loaded from API and it causes issues on our side where we want to show icons preferably loaded locally. That is why I believe Tailwind icons can be great.

Anyway, I tried the package and failed to get the results displaying the icon. I am using Tabler preset (https://www.npmjs.com/package/@iconify-json/tabler) and Icon component does not render.

Here is my reproduction: https://github.com/frasza/nuxt-icon-tw

Maybe I am doing something wrong?

Thanks!

AndyL4N commented 5 months ago

Hi, @frasza.
I got the same issue. Just check an order of nuxt modules' definition. If you place it right as described in docs - it should work: export default defineNuxtConfig({ modules: ['nuxt-icon-tw', '@nuxtjs/tailwindcss'], })

At least 'nuxt-icon-tw' should be defined before '@nuxtjs/tailwindcss'.

ineshbose commented 1 month ago

Seems like the order of module may have been the issue - but the latest version of @nuxtjs/tailwindcss should not care about module being registered before! (https://github.com/nuxt-modules/tailwindcss/issues/826) 🙂