<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new -->
Do you want to request a feature or report a bug? Reporting a bug regarding the yarn build.
What is the current behavior?
yarn build --watch is throwing
Here's the complete log:
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
The bug is related to
yarn build. If we run yarn build with watch mode enabled, then it's throwing out of memory exception.
What is the expected behavior? It should not throw an exception.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Not sure about the previous versions. I am exploring the code base of React for learning.
OS: macOs Mojave Version: 10.14.3(18D109) MacBook Pro (Retina, 15-inch, Mid 2015) Processor: 2.2 GHz Intel Core i7 Memory: 16 GB 1600 MHz DDR3
NodeJs: v10.15.1 npm: 6.9.0
Answer questions Dergash
Hello @hk-skit! It's not the problem with React itself but with your build process. NodeJS has a limited heap size (~1.5 GB) that might not be enough for your app to launch with '--watch' mode. You could use '--max-old-space-size' flag to set a different heap size. Here are examples for webpack and for create-react-app.