tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Layers from pnpm workspace not compile

Open aminmokhtari94 opened this issue 6 months ago • 10 comments

Environment

  • Operating System: Linux
  • Node Version: v22.14.0
  • Nuxt Version: 3.17.5
  • CLI Version: 3.25.1
  • Nitro Version: 2.11.13
  • Package Manager: [email protected]
  • Builder: -
  • User Config: extends, compatibilityDate, devtools, ssr, modules
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

Describe the bug

Nuxt layer not compile when extended from pnpm workspace pacakge

home page and layout classes from base layer not compiled (scanned) but classes in /test page compiled.

Additional context

I using same pnpm workspace for my project, i facing same bug while upgrading Nuxt UI to version 3.

Logs


aminmokhtari94 avatar Jul 01 '25 06:07 aminmokhtari94

Hello @pi0, is there any misconfiguration in my setup?

aminmokhtari94 avatar Jul 01 '25 06:07 aminmokhtari94

Seeing the same thing using the new Nuxt4 directory structure and compatibility mode 4.

Any tailwind classes inside /layers are not compiled.

bask-digital avatar Jul 03 '25 20:07 bask-digital

Hello, is there any misconfiguration in my setup?

Hey - I'll triage your issue; just remind me if I don't get back to you by Friday.

ineshbose avatar Jul 12 '25 19:07 ineshbose

Hi @ineshbose , any update?

aminmokhtari94 avatar Jul 19 '25 07:07 aminmokhtari94

Thanks for the ping and sorry for the delay.

I see what is causing the issue.. the module is detecting base/assets/css/main.css that is importing tailwindcss so it is thinking that you are manually handling importing of tailwind (this happens over nuxt.config defu'd with layer config, but it also shouldn't be a problem..).

Give a minute, I'm trying to figure out what could be the fix here (we generate sources.css but the import doesn't seem to be working either)

ineshbose avatar Jul 20 '25 17:07 ineshbose

Hi. I think, I have similar problem https://github.com/nuxt-modules/tailwindcss/issues/1012

goldbocman avatar Jul 21 '25 14:07 goldbocman

This works for me:

tailwindcss: {
    cssPath: '~/assets/css/tailwind.css'
  },

dongnaebi avatar Aug 12 '25 08:08 dongnaebi

Hi @dongnaebi , i tested this config on https://github.com/aminmokhtari94/nuxt-tailwind-bug-reproduce but not working, can describe how to do it?

aminmokhtari94 avatar Aug 18 '25 09:08 aminmokhtari94

Hi @dongnaebi , i tested this config on https://github.com/aminmokhtari94/nuxt-tailwind-bug-reproduce but not working, can describe how to do it?

I later found out that only part of it is usable, and now I’m also waiting for this issue to be resolved.

dongnaebi avatar Aug 19 '25 08:08 dongnaebi

Also experienced this issue after upgrading from Nuxt 3 (w/ future compatabilityVersion defined) to Nuxt 4.

Explicitly defining the cssPath as @dongnaebi pointed out is a valid workaround.

In my case, seems like the default path value stopped working as expected https://tailwindcss.nuxtjs.org/getting-started/module-options#csspath

arkoannuk avatar Oct 31 '25 09:10 arkoannuk