Check out a free preview of the full Debugging and Fixing Common JavaScript Errors course

The "Challenge 4: One User, Many Errors" Lesson is part of the full, Debugging and Fixing Common JavaScript Errors course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge, students attempt to determine why a user's data is not showing up.

Preview
Close

Transcript from the "Challenge 4: One User, Many Errors" Lesson

[00:00:00]
>> Here we have another bug that we caught by monitoring. And this time we're seeing a single user is just having a really bad time. So we see only one user has had an error 2100 times. And they're having this error cannot read substr of null, you could argue that hey, maybe it's just one user.

[00:00:24]
Maybe it's just one really annoying user, maybe it's Phil in Accounting and you just tired of dealing with him. But you know, with getRANTR, I want all of my users to have an excellent experience. So if you have the ability to impersonate individual users, you can look at what is going on with this particular user and see what's going on.

[00:00:44]
Fortunately, with getRANTR, we have that ability, so, the first step to taking a look at this is we need to go into our console. And we're going to stop the service from running and I wanna switch my user again. I'm going to switch using node import 3 to switch to user 3, which happens to be the user that was having a hard time.

[00:01:11]
And we are going to import user Alt Todd and then I'm going to restart my server using npm start. Reloading the page, I should see the AltTodd account. The AltTodd account does not seem to be very healthy, there's nothing going on. Maybe they've just never ranted, maybe they've never done anything.

[00:01:49]
So let's see if they can, Or they can add a new one. But if we reload the page, it's gone again. We're getting some errors in the console too, this sure looks like the error we are monitoring caught this, cannot read property substr of null. The real problem with this error is that it's a huge user experience impact for this user.

[00:02:19]
They think that their data is gone, every time they visit getRANTR, their entire timeline is missing. And they can add some new stuff, but as soon as they come back, it's gone again, so that's a really bad UX. So let's use some of the tech tools and techniques that we've already talked about.

[00:02:36]
And see if you can take a look using user 3, see if you can troubleshoot what's going on with this issue. We'll take one more 10 minute break, and we'll come back we'll solve it together.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now