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

Docker environment not injecting tailwind.css #695

Open
twf-nikhila opened this issue Jun 26, 2023 · 10 comments
Open

Docker environment not injecting tailwind.css #695

twf-nikhila opened this issue Jun 26, 2023 · 10 comments

Comments

@twf-nikhila
Copy link

twf-nikhila commented Jun 26, 2023

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

@twf-nikhila twf-nikhila added the question Further information is requested label Jun 26, 2023
@ineshbose
Copy link
Collaborator

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

@twf-nikhila
Copy link
Author

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
Copy link
Author

Did you find anything @ineshbose ?

@ineshbose
Copy link
Collaborator

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

@ineshbose ineshbose added the need-repro Issue needs reproduction label Jun 29, 2023
@luca-smartpricing
Copy link

luca-smartpricing commented Jul 3, 2023

The fix was:

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

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

@Jogiter
Copy link

Jogiter commented Jul 5, 2023

The fix was:

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

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

save my day 👍

@CernyMatej
Copy link

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
Copy link
Collaborator

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
Copy link

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 ineshbose added has-workaround pending and removed question Further information is requested need-repro Issue needs reproduction labels Nov 19, 2023
@ineshbose
Copy link
Collaborator

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)

shershen08 added a commit to juicyllama/framework that referenced this issue Jan 27, 2024
@ineshbose ineshbose changed the title Some Classes not working in production, but works in local Docker environment not injecting tailwind.css Jan 27, 2024
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

5 participants