Repository: create-react-app
Issue: JavaScript heap out of memory - FATAL ERROR
Labels: needs triage,issue: bug report

<!--
    Please note that your issue will be fixed much faster if you spend about
    half an hour preparing it, including the exact reproduction steps and a demo.

    If you're in a hurry or don't feel confident, it's fine to report bugs with
    less details, but this makes it less likely they'll get fixed soon.

    In either case, please use this template and fill in as many fields below as you can.

    Note that we don't provide help for webpack questions after ejecting.
    You can find webpack docs at https://webpack.js.org/.
-->

### Describe the bug

I'm getting Javascript Heap out of memory after updating the react-scripts to 5.0.1, please anyone help me to resolve this issue

### Did you try recovering your dependencies?

<!--
  Your module tree might be corrupted, and that might be causing the issues.
  Let's try to recover it. First, delete these files and folders in your project:

    * node_modules
    * package-lock.json
    * yarn.lock

  Then you need to decide which package manager you prefer to use.
  We support both npm (https://npmjs.com) and yarn (https://yarnpkg.com/).
  However, **they can't be used together in one project** so you need to pick one.

  If you decided to use npm, run this in your project directory:

    npm install -g npm@latest
    npm install

  This should fix your project.

  If you decided to use yarn, update it first (https://yarnpkg.com/en/docs/install).
  Then run in your project directory:

    yarn

  This should fix your project.

  Importantly, **if you decided to use yarn, you should never run `npm install` in the project**.
  For example, yarn users should run `yarn add <library>` instead of `npm install <library>`.
  Otherwise your project will break again.

  Have you done all these steps and still see the issue?
  Please paste the output of `npm --version` and/or `yarn --version` to confirm.
-->

yes i have done this and reinstalled the packages 

### Which terms did you search for in User Guide?

<!--
  There are a few common documented problems, such as watcher not detecting changes, or build failing.
  They are described in the Troubleshooting section of the User Guide:

  https://facebook.github.io/create-react-app/docs/troubleshooting

  Please scan these few sections for common problems.
  Additionally, you can search the User Guide itself for something you're having issues with:

  https://facebook.github.io/create-react-app/

  If you didn't find the solution, please share which words you searched for.
  This helps us improve documentation for future readers who might encounter the same problem.
-->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
JavaScript heap out of memory
Reached heap limit Allocation failed

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

"scripts": {
"start": "set NODE_ENV=Production && react-scripts start",
"dev": "set NODE_ENV=development && react-scripts start",
"build": "react-scripts build",
"start-docker": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"ce-ignore": "react-scripts start --ce-ignore"
},

### Steps to reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

(Write your steps here:)

1. I have upgraded the node-sass 9.0.0 and react-scripts 5.0.1 for react 18.0.2 version in package.json
2. Install the packages and tried to start application while starting the application I'm always getting the warning message as
[13816:000002A92D6B0700]  8090000 ms: Scavenge 1833.3 (1959.0) -> 1831.6 (1975.0) MB, 18.4 / 0.0 ms  (average mu = 0.983, current mu = 0.973) allocation failure; 
[13816:000002A92D6B0700]  8092184 ms: Mark-sweep (reduce) 2402.3 (2536.2) -> 2401.7 (2500.8) MB, 551.6 / 0.0 ms  (+ 10.4 ms in 144 steps since start of marking, biggest step 0.5 ms, walltime since start of marking 2184 ms) (average mu = 0.951, current mu 

<--- JS stacktrace --->

**FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory**
 1: 00007FF715CD07BF node_api_throw_syntax_error+175823
 2: 00007FF715C55796 DSA_meth_get_flags+59654
 3: 00007FF715C57480 DSA_meth_get_flags+67056
 4: 00007FF7166FE944 v8::Isolate::ReportExternalAllocationLimitReached+116
 5: 00007FF7166E9CD2 v8::Isolate::Exit+674
 6: 00007FF71656BB8C v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
 7: 00007FF716568DAB v8::internal::Heap::CollectGarbage+3963
 8: 00007FF71657EFE3 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
 9: 00007FF71657F88D v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
10: 00007FF7165881BF v8::internal::Factory::AllocateRaw+783
11: 00007FF71659EA6A v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller+90
12: 00007FF71659E97D v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArray+77
13: 00007FF7165900E1 v8::internal::Factory::NewJSArrayStorage+145
14: 00007FF71658FA26 v8::internal::Factory::NewJSArray+150
15: 00007FF7164906EC v8::base::TimeDelta::operator!=+19564
16: 00007FF7164958D6 v8::base::TimeDelta::operator!=+40534
17: 00007FF71649383A v8::base::TimeDelta::operator!=+32186
18: 00007FF716692E0D v8::internal::Builtins::code+98989
19: 00007FF716692EE0 v8::internal::Builtins::code+99200
20: 00007FF71679BF71 v8::internal::SetupIsolateDelegate::SetupHeap+558449
21: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
22: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
23: 00007FF71671D076 v8::internal::SetupIsolateDelegate::SetupHeap+38518
24: 00007FF71683A373 v8::internal::SetupIsolateDelegate::SetupHeap+1206643
25: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
26: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
27: 00007FF71671D076 v8::internal::SetupIsolateDelegate::SetupHeap+38518
28: 00007FF71683A373 v8::internal::SetupIsolateDelegate::SetupHeap+1206643
29: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
30: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
31: 00007FF71671D076 v8::internal::SetupIsolateDelegate::SetupHeap+38518
32: 00007FF71683A373 v8::internal::SetupIsolateDelegate::SetupHeap+1206643
33: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
34: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
35: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
36: 00007FF71671F884 v8::internal::SetupIsolateDelegate::SetupHeap+48772
37: 00007FF6971F636C

### Expected behavior

<!--
  How did you expect the tool to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

Application have to run without any issue

### Actual behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Please attach screenshots if possible! They are extremely helpful for diagnosing issues.
-->

<img width="814" alt="image" src="https://github.com/facebook/create-react-app/assets/58289797/2b2c52a4-cb50-4891-9d19-b339f372266a">

### Reproducible demo

<!--
  If you can, please share a project that reproduces the issue.
  This is the single most effective way to get an issue fixed soon.

  There are two ways to do it:

    * Create a new app and try to reproduce the issue in it.
      This is useful if you roughly know where the problem is, or can’t share the real code.

    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.
      This is useful for finding the root cause. You may then optionally create a new project.

  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve
  Once you’re done, push the project to GitHub and paste the link to it below:
-->

{
  "name": "rnstool",
  "version": "0.1.0",
  "private": true,
  "main": "app.js",
  "dependencies": {
    "@carbon/icons-react": "^11.21.0",
    "@carbon/upgrade": "^11.8.0",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^1.4.0",
    "carbon-components": "^10.58.5",
    "carbon-components-react": "^7.59.5",
    "carbon-icons": "^7.0.7",
    "formik": "^2.2.6",
    "html-react-parser": "^4.0.0",
    "http-proxy-middleware": "^1.1.1",
    "ibmcloud-appid-js": "^0.4.1",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.40",
    "nginx": "^1.0.8",
    "node-sass": "^9.0.0",
    "react": "^18.2.0",
    "react-csv": "^2.0.3",
    "react-datepicker": "^3.8.0",
    "react-dom": "^18.2.0",
    "react-excel-renderer": "^1.1.0",
    "react-export-excel": "^0.5.3",
    "react-intl-currency-input": "^0.2.6",
    "react-multi-email": "^1.0.14",
    "react-number-format": "^4.4.4",
    "react-redux": "^7.2.2",
    "react-router-dom": "^6.13.0",
    "react-scripts": "5.0.1",
    "react-scroll": "^1.8.2",
    "react-select": "^5.2.1",
    "react-to-print": "^2.14.7",
    "read-excel-file": "^5.2.25",
    "redux-thunk": "^2.3.0",
    "web-vitals": "^3.5.0",
    "xlsx": "^0.17.5",
    "yup": "^0.32.8"
  },
  "scripts": {
"start": "set NODE_ENV=Production && react-scripts start",
"dev": "set NODE_ENV=development && react-scripts start",
"build": "react-scripts build",
"start-docker": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"ce-ignore": "react-scripts start --ce-ignore"
},
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "chokidar": "^3.5.3",
    "redux": "^4.1.2"
  }
}


<!--
  What happens if you skip this step?

  We will try to help you, but in many cases it is impossible because crucial
  information is missing. In that case we'll tag an issue as having a low priority,
  and eventually close it if there is no clear direction.

  We still appreciate the report though, as eventually somebody else might
  create a reproducible example for it.

  Thanks for helping us help you!
-->