MongoDB data sometimes doesn't load on my webpage after verification

I am running a Javascript localhost application using a Mongo database. About one in every 5 times I sign in past the login page, the data doesn’t load and requires a page refresh and another login to work again.

Is this the database connection, or a problem with the sign in page or something else entirely?