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

Performance issue with versions greater than >4.0.9 #17318

Open
sibiraj-s opened this issue Mar 21, 2025 · 8 comments · May be fixed by #17255
Open

Performance issue with versions greater than >4.0.9 #17318

sibiraj-s opened this issue Mar 21, 2025 · 8 comments · May be fixed by #17255
Labels

Comments

@sibiraj-s
Copy link

What version of Tailwind CSS are you using?

v4.0.15

What build tool (or framework if it abstracts the build tool) are you using?

Next 15.2.3

What version of Node.js are you using?

Node 22

What browser are you using?

N/A

What operating system are you using?

Vercel

Reproduction URL

N/A

Describe your issue

Recently I have updated tailwindcss from v4.0.12 in one of my private project, the project is built on vercel, after updating the project takes a lot of time to build

Image

just tailwindcss and tailwindcss/postcss are updated from 4.0.9 to 4.0.15. no other changes.
After downgrading tailwindcss/postcss to v4.0.9, the builds are back to normal. In some project with considerable size, the build never finishes on vercel.

Image

Note: There are no code changes between the upgrades and downgrades.

Works fine locally though, maybe because of the compute is higher on local machine.

@sibiraj-s
Copy link
Author

Not sure if it has any relation underneath to #16911, Here issue seems related to @tailwindcss/postcss not vite

@filipbekic01
Copy link

filipbekic01 commented Mar 21, 2025

Performance issues are for versions > 4.0.7. I tested hot reload and it's extremely slow (takes about 3 seconds to change simple text) on macbook m1 pro.

There was a change in version 4.0.8 that decreased speed drastically.

@adamwathan
Copy link
Member

Hey! Can you check if maybe it’s this problem? #17092 (comment)

@sibiraj-s
Copy link
Author

Yes @adamwathan . thats the problem. The comment on the issue fixed it. adding !.gitignore to .vercelignore file fixes the issue. The vercel builds are back to normal. TBH, builds are actually faster than early 4.x versions I used on my projects

My bad, I didn't think to check on the closed issues, since it was still happening.

Also, the issue seems to be closed with a fix #17123 which is released as part of v4.0.13 but this is still happening with the latest version too.

@philipp-spiess
Copy link
Member

@sibiraj-s Glad you found the fix! We're working on some changes that will hopefully make this issue not as profound in the future but ensuring the .gitignore file is uploaded to Vercel so that we know your ignores during a build there is still a good idea 👍 Going to close this issue as fixed for now but lmk if you still need anything.

@filipbekic01 If your issue still persists, do you mind creating a new GitHub issue and attaching a reproduction so we can check this out? Thanks!

@sibiraj-s
Copy link
Author

sibiraj-s commented Mar 21, 2025

thanks @philipp-spiess I am currently going with this solution.

I first noticed this issue in one of my project with considerable size, It took me at-least two hours to identify the issue, since this happened while migrating from tailwind 3 -> 4 with other dependencies too and several changes due to migration. I didn't suspect tailwindcss tbh 😅 . Was looking at every other places.

May be do you think its worth keeping it open unless fixed completely or mention in the framework guide https://tailwindcss.com/docs/installation/framework-guides/nextjs or migration guide or somewhere. so others can find upfront or find solution easily if they endup in same situation?

@philipp-spiess
Copy link
Member

@sibiraj-s Haha sure happy to keep it open but our idea is to ensure we add better defaults for what to scan in the absence of a .gitignore file so hopefully that .vercelignore file isn't necessary. Also if you have a repro that we can use to find out which files were scanned that were so slow it could also help!

@sibiraj-s
Copy link
Author

sibiraj-s commented Mar 21, 2025

Thanks @philipp-spiess .

our idea is to ensure we add better defaults for what to scan in the absence of a .gitignore file so hopefully that .vercelignore file isn't necessary.

understood. and yeah that would be the better fix.

And to reproduce,

I have some repos most of them are private, which I couldn't share. Here is one https://github.com/usegranthq/docs that had the issue. I've added the vercelignore hack and it worked. In this repo unlike others the build doesn't hung completely, usually it takes 1min or less to build the app, but without adding gitignore, it takes like ~20mins approx (never less than 16-17mins ).

@philipp-spiess philipp-spiess linked a pull request Mar 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants