6

Note: You can download the whole project here. It's basically a practice project following the youtube tutorial from JSMastery here.

Symptoms

  1. It crahsed in chrome browser
  2. It also crashed like this in Microsoft Edge.
  3. I used another profile in chrome, and it resulted the same.
  4. No apprant compile errors.
  5. It was working fine before the holiday, and during holiday I haven't launched it once, when I am back it just failed.
  6. It also crashed in Firefox Browser.

By the way, chrome is up to date: Chrome version

ReactApp

Possible causes of this problem:

  1. I installed league of legends in System drive (I know it doesn't matter, but just in case)
  2. I reinstalled my nodeJS from F disk into C disk, which is the system drive. I did this because when I first launched my ReactApp today, it cannont even use npm since it cannont find the "main" entry. (I don't understand that error so I reinstalled it instead.)
  3. BIOS system started warning me that my hard drive is failing, asking me to press f1 to resume everytime I restart my computer.

I ran my app in vs code, here's what that console in vs code looks like: enter image description here

Shane Li
  • 73
  • 1
  • 9
  • Turns out I had too many heavy extensions and each of them consumed memory when not in use. A restart helped, but removing them was better. Instead I relegated those extensions to another profile that I only use on machines with more RAM. – Ray Foss Sep 16 '22 at 13:39

4 Answers4

2

An answer for anyone who came up here because was looking for an answer to the question "Why am I getting Aw, snap error in my React app?".

Just a small hint - in my case it was happening because in my custom component I have used a function that was accidentally generating infinite loop :)

So yes, it was a memory problem. Above is just a hint what you can look for in your code.

Alena Levina
  • 103
  • 1
  • 8
1

I faced such problem! Endless loop! Problem solved!

const arr1 = [11, 4, 8, 2, 23, 55, 67, 66];

const filteredNims = (arr) => {
const arrEvenNum = [];
const arrOddNum = [];//created to solve the problem and replaced with arr

  for (let i = 0; i < arr.length; i++) {
    if (arr[i] % 2 === 0) {
      arrRes.push(arr[i]);
    } else if (arr[i] % 2) {
      arr.push(arr[i]);//Here was proplem.Endless loop
    }
  }
  return arrRes;
};

console.log(filteredNims(arr1));
0

This was happening to me and ended up being caused by a syntax error in one of my components

cormacncheese
  • 1,251
  • 1
  • 13
  • 27
  • 1
    One friend told me that it may be because the running out of memory. And I also had a driver failing issue at that time. So maybe that's a good reason for a memory leak. – Shane Li Jan 24 '22 at 14:45
-1

From documentation:

Fix "Aw, Snap!" page crashes and other page loading errors If you're getting the "Aw, Snap" error or another error code instead of a webpage, Chrome is having problems loading. You might also see the page loading slowly or not opening at all.

Page loading error codes and issues To fix an error, try the fixes below.

Computer AndroidiPhone & iPad Reload the page Usually, you can reload the page to fix the error.

At the top left, click Reload Reload.

If that didn't work... Step 1: Check your internet connection Make sure your computer's connected to Wi-Fi or a wired network.

Try reloading the tab with the error.

Step 2: Clear your cache Chrome might have information stored that's stopping the page from loading.

Open the page in an Incognito window On your computer, open Chrome. At the top right, click More More and then New Incognito window. In the Incognito window, try opening the page. If it opens, clear your cache and cookies. Clear your cache and cookies At the top right, click More More and then More tools and then Clear browsing data. Next to "Time range," select All time. Select Cached images and files and Cookies and other site data. Deselect the other types of data. Click Clear data. Try reloading the tab with the error. Step 3: Close other tabs, extensions, & apps Your device may have run out of memory, and can't load the site while also running your apps, extensions, and programs.

Free up memory: Close every tab except for the one that’s showing the error message. Quit other apps or programs that are running, and pause any app or file downloads. Uninstall unnecessary extensions from Chrome. At the top right, click More More and then More tools and then Extensions. On extensions you don't use, click Remove. Try reloading the tab with the error. Still not working? Step 4: Restart your computer Step 5: Update Chrome Step 6: Check for unwanted software

MWO
  • 2,627
  • 2
  • 10
  • 25
  • Hey, thank you for the answer. Unfortunately, as stated before, I don't think it's the browser's problem since I also tried it on the edge browser. and the cache is only 20 mb, while my system drive still has 50 gb available. My RAM is also 16 GB in total, still has 9 GB remaining when running Chrome. I will try firefox browser later tho. – Shane Li Jan 11 '22 at 19:35