gitFoxCode / nuxt-icons

Module for Nuxt allowing pleasant use of svg icons
187 stars 23 forks source link

Icons aren't rendered on the SSR #39

Closed szobX closed 1 year ago

szobX commented 1 year ago

Describe the bug Icons in wrapper aren't rendered on the SSR

To Reproduce typical use NuxtIcon component. (client-only is not used anywhere above)

  <button
            aria-describedby="cart"
        >
            <NuxtIcon name="cart" filled class="text-2xl lg:text-3xl relative" aria-hidden="true" />
            <span
                v-if="isFull"
                class="w-[7px] h-[7px] bg-green block rounded-full absolute top-0 -right-0.5 lg:top-1"
                aria-hidden="true"
            />
        </button>

Expected behavior Icons should render at ssr

Screenshots Screen from SSR preview ( extension for chrome) image

After render all image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

MathiasOxholm commented 1 year ago

Experiencing the same issue here. This results in layout shift on the webshop I'm currently developing

Aira-Sakuranomiya commented 1 year ago

Same problem here.

gitFoxCode commented 1 year ago

@Aira-Sakuranomiya @MathiasOxholm @szobX I made a new version, check if the problem still occurs and if there are any other problems - from now on icons with stroke are detected automatically and their stroke color is matched to the text color which may affect projects where someone tried to circumvent this problem using CSS

szobX commented 1 year ago

@gitFoxCode after upgrade package to latest works perfectly! thx

jasonhibbs commented 1 year ago

fixed for me!