DEV Community

Theivendram Athavan
Theivendram Athavan

Posted on

Running out of memory when running `craco build` on bitbucket pipline

Image description

got this error when deploying the branch in gitlab. changes made before the deployment were ( in package.json )

"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject",
"format": "prettier --write src//*.ts{,x}",
"lint": "tsc --noEmit && eslint src/
/*.ts{,x}"

},

later fixed this error by modifying the above script as follows

"scripts": {
"start": "craco --max_old_space_size=4096 start",
"build": "craco --max_old_space_size=4096 build",
"test": "craco test",
"eject": "react-scripts eject",
"format": "prettier --write src//*.ts{,x}",
"lint": "tsc --noEmit && eslint src/
/*.ts{,x}"
},

am new to craco. I have used craco to customize the antd theme and followed the guidelines mention in their documentation. later on, I went through the usage of craco but still, I don't have complete knowledge in craco. I need some explanation why it has not given an error without craco and it's giving an error when using craco. so does this mean craco will consume more memory than using react-script start

Top comments (0)