Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon not visible after build on nuxt3, ok in dev mode since last version v0.45.30 #1782

Closed
slarrasoain opened this issue Oct 20, 2022 · 9 comments

Comments

@slarrasoain
Copy link

slarrasoain commented Oct 20, 2022

After upgrade in v0.45.30 icon are not visible on my project after build.
I can reproduce it with a fresh install of Nuxt3 RC12 RC11
Add @unocss/nuxt nuxt module and @iconify-json/mdi collection
npm i @unocss/nuxt @iconify-json/mdi

My nuxt.config.ts

 // https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
    ssr:true,
    modules: [
      '@unocss/nuxt',
    ],
    unocss: {
      // presets
      uno: false, // enabled `@unocss/preset-uno`
      icons: true, // enabled `@unocss/preset-icons`
      attributify: true, // enabled `@unocss/preset-attributify`,
  
      // core options
      shortcuts: [],
      rules: [],
    }
})

My app.vue

<template>
     <div>
        <div class="i-mdi-pencil"></div>
    </div>
</template>

All run well with :
npm run dev
But icon is not visible after build
npm run build
with :
npm run preview

@zyyv
Copy link
Member

zyyv commented Oct 20, 2022

Can you provide a minimal repo? it works well in my local.

@slarrasoain
Copy link
Author

Sorry I made a mistake on my description. I am in rc11 of nuxt3.
Just try with rc12 and all run well, but can't use rc12 for the moment because vite proxy dev server didn't work on nuxt3 rc12

@zyyv
Copy link
Member

zyyv commented Oct 20, 2022

If there is no problem and it works fine, please close it. Or not, i will reopen it.

@AndrewBogdanovTSS
Copy link
Contributor

AndrewBogdanovTSS commented Oct 26, 2022

It's not working fine, I'm using Nuxt RC12 but still have the same issue. Problem is that icons aren't visible if JS is disabled (without hydration) on the page, for some reason generated CSS is not bound to class selectors. @chris-zhu could you reopen?
image
image
image

@zyyv zyyv reopened this Oct 26, 2022
@antfu
Copy link
Member

antfu commented Nov 1, 2022

Seems to work fine on https://github.com/antfu/vitesse-nuxt3

Can any one provide a reproduction repo?

@AndrewBogdanovTSS
Copy link
Contributor

@antfu it's working fine because you disabled inlineSSRStyles here https://github.com/antfu/vitesse-nuxt3/blob/main/nuxt.config.ts#L10
I think it should somehow be stated in the docs that it's a known issue with Nuxt 3

@antfu
Copy link
Member

antfu commented Nov 1, 2022

It's a bug we are investigating on Nuxt.

@AndrewBogdanovTSS
Copy link
Contributor

yes, I understand that, but it's blocking correct behavior of UnoCSS including icons rendering

@antfu
Copy link
Member

antfu commented Nov 1, 2022

In that sense, I would consider this not a bug of UnoCSS. Please track on nuxt/nuxt#15213 instead.

@antfu antfu closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants