Runs perfect on localhost, but loads forever when deployed

My app runs perfectly on localhost, but when I deploy it using Heroku, it runs forever and the loading never ends. What should I do?