nuxt-modules / tailwindcss

Tailwind CSS module for Nuxt
https://tailwindcss.nuxtjs.org
MIT License
1.62k stars 181 forks source link

Docker environment not injecting `tailwind.css` #695

Open twf-nikhila opened 1 year ago

twf-nikhila commented 1 year ago

Here is the screenshot of code:

image

In local it works fine, and shows a gradient color around the button

But in production or on running npx nuxt generate

It doesn't show the gradient color.

On doing inspect element it shows the class present in source code, but doesn't gets applied somehow

image

ineshbose commented 1 year ago

Could this be related to your content configuration? Can you provide a reproduction over Stackblitz please?

twf-nikhila commented 1 year ago

Could this be related to your content configuration? Can you provide a reproduction over Stackblitz please?

Here it is on Netlify:

https://pictweak.netlify.app/

check the download & copy button design , originally should appear like this: image

But doesn't

twf-nikhila commented 1 year ago

Did you find anything @ineshbose ?

ineshbose commented 1 year ago

Thanks for linking a deployment - but I'd need to look at the source code as well please, so a reproduction over a web container editor would be ideal.

You can use this as a starter - https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz?file=README.md

luca-smartpricing commented 1 year ago

The fix was:

export default defineNuxtConfig({
  experimental: {
    inlineSSRStyles: false
  }
})

I think this fix (https://github.com/nuxt/nuxt/pull/21573) break the tailwind plugin

Jogiter commented 12 months ago

The fix was:

export default defineNuxtConfig({
  experimental: {
    inlineSSRStyles: false
  }
})

I think this fix (nuxt/nuxt#21573) break the tailwind plugin

save my day 👍

CernyMatej commented 8 months ago

Thank you for the workaround by disabling the experimental option; it has resolved the issue for me as well. Btw. are there any updates on the progress of a fix within this module?

ineshbose commented 8 months ago

Hi, I'm still not aware of what is causing this bug because I haven't encountered it yet - can you provide a reproduction please and I'll investigate as quickly as possible?

CernyMatej commented 8 months ago

Interestingly, the issue occurs exclusively when building the app within a Docker container. (at least for me) It works as expected on StackBlitz, as well as locally on my MacBook.

Here is a minimal reproduction: https://github.com/CernyMatej/tailwind-styles-reproduction

To reproduce the issue, build it with:

docker build . -t test

docker run -p 3000:3000 test

The Tailwind styles do not appear in the production build. However, if you uncomment inlineSSRStyles: false in nuxt.config.ts, it works as expected.

ineshbose commented 5 months ago

Sorry it took me a while to get to this, it seems that nuxt.options.css isn't being resolved into the Nuxt project - are all other styling working? (global CSS, outside of component <style> tags most likely)

ineshbose commented 2 weeks ago

Quick follow up on this issue - does it persist on the latest versions of Nuxt, Vite and this module?