Watch command throws "JavaScript heap out of memory" while using with tailwindcss
See original GitHub issue- Laravel Mix Version:
6.0
- Node Version (
node -v
):15.4
- NPM Version (
npm -v
):6.14.8
- OS:
Description:
I am using laravel-mix
with tailwindcss
and compiling with SASS. When running on “npm run watch
”, the first compilation takes some time but does it successfully. After i make a small change on one of the file, the command throws error like “FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
”.
I hoped that it would be solved in version 6 but it still persists. After trying out these solutions on #2470 and others but still to no vein.
So far debugging it i found that if i don’t import @tailwind utilities, there’s no any issue. However I do not have any work around it.
Here’s my webpack.mix.js file:
// Compile SASS/CSS.
mix.sass( `${devPath}/scss/app.scss`, 'css', sassConfig )
.options({
processCssUrls: false,
postCss: [ tailwindcss('./tailwind.config.js') ]
})
My app.scss file:
@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'settings/_index';
@import 'tools/_index';
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:9
Top Results From Across the Web
Watch command throws "JavaScript heap out of memory ...
I am using laravel-mix with tailwindcss and compiling with SASS. When running on " npm run watch ", the first compilation takes some...
Read more >Watch command slow and sometimes throws "JavaScript ...
Watch command slow and sometimes throws "JavaScript heap out of memory" while using with tailwindcss.
Read more >Tailwind CSS (PostCSS Plugin) with Next.js 10.0.3 gives ...
I have set up Gulp for Tailwindcss and pm2 to restart when memory exceeds 1024 MB. I know this setup is very annoying...
Read more >How to solve JavaScript heap out of memory error
To fix JavaScript heap out of memory error, you need to add the --max-old-space-size option when running your npm command. Here's an example...
Read more >Ineffective mark-compacts near heap limit Allocation failed ...
How to fix FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory in nodejs, try it 100%...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ponopress not sure if you’re still having this issue but I was able to work around it by adjusting my package.json file to include the node module flag to increase the maximum memory (in my example to 8000 MB):
In case anyone is looking for the reference to building tailwind using NPX, see the following page: https://tailwindcss.com/docs/installation#building-your-css