Next.js 10.0.3 gives Javascript heap out of memory error in dev environment with Tailwind CSS (PostCSS Plugin) #21319
-
Describe the problem: Hot reloading is slow (even if I manage it in some way) but the real pain is Next.js+tailwinds setup takes 3-4x memory compared to others (like I was using Bulma) Link to a minimal reproduction: and run it in next.js dev environment and watch out your memory usage (generally it remains around 200-300MB but with Tailwinds 1.2GB). I tried to debug it and as soon as I disable tailwinds plugin in PostCSS everything again goes normal. The real problem seems to be in tailwinds PostCSS Plugin, is there any way to reduce memory usage or fix this issue? PS: The real problem is I don't want to trigger Out of memory error on the server during the build time. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Hey @ceodigvijay, I happen t be using the same stack and I am seeing this as well, memory just skyrockets as it tries to build it out, I have not observed this in production. Should we raise this as a bug? Maybe there is something we need to do with tailwind. I suspect it is because it tries to build tailwind for every page or something but just an idea. Even then, it feels like a lot of memory. |
Beta Was this translation helpful? Give feedback.
-
The solution here is to use the new Tailwind JIT Compiler! The Tailwind + Next.js has also been updated. |
Beta Was this translation helpful? Give feedback.
The solution here is to use the new Tailwind JIT Compiler!
The Tailwind + Next.js has also been updated.