2

To replicate the issue you can use this example and run in the dev environment.

https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss

The above example have also very high memory usage in dev environment which is not so common for next js applications.

I have tried the combination of different versions of tailwindcss and Next.js but the issue persists. PS: I am using Ubuntu 20.04 (If this would help in any way).

2
  • Did you fined a solution for this, I'm also on Ubuntu 20.04 Jan 13, 2021 at 20:59
  • I have set up Gulp for Tailwindcss and pm2 to restart when memory exceeds 1024 MB. I know this setup is very annoying but I didn't found any other solution for this. Jan 14, 2021 at 12:50

1 Answer 1

1

I too encountered this error FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory when I integrated Tailwind(2.2.2) on my NextJS (10.2) project.

Some github-issue discussions on Memory Leaks points to the use of optimized <Image/> component of NextJs. So I've temporarily reverted back to img tag and it's stable so far.

No an ideal solution but give it a try.

Also I've disabled JIT mode of Tailwind in development.

Github Discussions #1 #2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.