-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[Bug][4.0.10 - 4.0.12] Very Slow Vercel CLI builds (30mins+) with Nuxt/Vite project using Tailwind >= 4.0.10 #17092
Comments
Hey! Can you still try to create a minimal reproduction repo? (and verify that your Vercel builds are slow with the minimal setup). In the meantime, I setup a Nuxt project with Tailwind CSS v4, you can find the repo here: https://github.com/RobinMalfait/nuxt-tailwindcssv4-vercel Then I connected it to Vercel, and it took 22seconds to deploy in Total: ![]() There must be something going on with your project that I can't explain right now 🤔 Did this slow build happen once, or is it an issue that keeps happening? |
Hi,
With the environment And an .npmrc
Even if I didn't have the I'll certainly get a reproduction made though, how interesting yours worked!! Thank you for your time on a Sunday evening. Perhaps a pnpm package manager thing... maybe I'm missing some other differences in your repo to mine. It happened every time as well, and I tried clearing build caches etc. |
EDIT: I'm in agreement, and was initially very confused.
|
EDIT:
~- Root - api/~~
|
Sorry, scratch that - I'll review this in the morning again. I thought I'd upgraded my project back to latest Tailwind, but I hadn't. The issue remains. I'll do more digging and figure out a reproduction tomorrow with a fresh head. It is something more specific - I have the entire application in another repo, just the front-end Nuxt application with Tailwind, and it builds fine. Even in a sub directory when just linked to the git repo. When I am trying to build from my actual repository, it has this issue with transforming. Most strange. |
Reproduced: In this case I have set my Root Directory in build settings to The build works fine when linked to the repository automatically. I'll do more work tomorrow to make the repo more minimal now I can see that there is a difference when it does the automated build or when the Vercel CLI is used. |
The reproduction is now as minimal as possible. Just like your example @RobinMalfait My config to make it so an automatic link will work is to set the Root directory in Vercel to Then from the root of the github rope just run |
Just my 2 cents on this topic, if that helps: I also had very long compilation time since version >=4.0.10, using gulp. After few hours trying to figure it out, I noticed the issue was gone once a specific package was uninstalled. Removing the package usage from the code was not enough, it had to be uninstalled. This leads me to believe 4.0.10 introduced changes in the I managed to fix the issue by setting up specific
This will still scan Additionally, I opened a suggestion to let |
@hawkidoki your 2 cents are worth a million dollars in this case. Thank you. Hopefully there will be some info in this ticket to resolve why so many files are being scanned which can cause this. Thanks for all your help. |
Summary of the issue now replicable on the same minimum implementation as shown by @RobinMalfait originally. I've updated my minimum reproduction repo. https://github.com/silverbackdan/tailwind-slow-test Vercel CLI time to build approx 29-37minutes. The workaround solution for now. /assets/css/main.css
Thank you all for helping me out on this issue to find out the scenario in which this can be reproduced and the workaround. If there's anything else I can do, or if the issue lies in another repo for the tailwind vite builder, please do let me know. I'm hoping with this info the issue which has occurred since 4.0.10 can be resolved in an easy way. |
Hey! We were able to reproduce this. It seems like the Vercel CLI automatically removes the However, to fix your immediate issue, please add a
|
@philipp-spiess - great stuff, thank you - what strange behaviour from Vercel but top response times and investigation from you folk in TW. Appreciate you lots. |
This PR adds a small JSON pre processor to improve parsing JSON files. Due to the sheer amount of potential `[` and `]` brackets, it could be that parsing JSON files are way slower than they need to be. We saw this while debugging this issue: #17092 # Test plan 1. Added test to verify the pre processing works 2. Existing tests still pass
We've identified that main reason for these slow builds and will include a fix for this in the next patch release. Thanks again! |
I saw the PR and makes total sense. Thank you too. Great to see the improvements found in the JSON pre-processor PR too. Have a great week. |
For information, the optimisation to include When I have my build cache disabled... v4.0.13 built in 42 seconds slower I then removed the environment variable which disabled the build cache it then built 4.0.14 in Then adding Conclusion: adding I'm not sure if Vercel started throttling me after a few builds, but I'd be interested to see if this fix proposed still has any impact for others in their build times. I'm feeling inclined to keep this fix in place for the potential build time gains and no downsides to keeping it in there. Thanks again all. Further to this, my builds are now |
What version of Tailwind CSS are you using?
For example: >= 4.0.10
What build tool (or framework if it abstracts the build tool) are you using?
Nuxt 3.16.0 with Vite 6.2.1
What version of Node.js are you using?
For example: v22.14.0
PNPM 10.6.1
What browser are you using?
n/a
What operating system are you using?
Vercel
Reproduction URL
A brand new Nuxt project setup as specified in docs. The issue is builds locally are absolutely fine. It's building within Vercel for these versions which has increased from ~1minute to 30mins+
There is a step in the Nuxt build script which says 'transforming' where I believe esbuild is transforming modules.
This happens twice in the build process, once for client, once for server. Each one takes around 15 minutes.
Any ideas?
I understand you'll ask for a reproduction, I totally get this and would usually try, but it'll build fine in regular environments, I'm happy to create a dummy repo if you have ability to deploy in Vercel or have ideas on what can cause this otherwise? Minimal reproduction is a basic Nuxt all with tailwind installed as docs show. Nothing else.
Describe your issue
I've had to use Tailwind v4.0.9 which is the latest version where the build is still nice and fast. What were the changes to 4.0.10 which may have caused such a slowdown in some environments?
The text was updated successfully, but these errors were encountered: