Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,665 members, 7,955,403 topics. Date: Sunday, 22 September 2024 at 04:04 AM |
Nairaland Forum / Science/Technology / Programming / Help With Node.js App Deployment To Heroku (Solved!!!) (823 Views)
What Other Alternative To Heroku / Why Is Heroku Not Setting My Cookie / Help On Deployment On Heroku (2) (3) (4)
Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 8:36am On Sep 02, 2020 |
Good day, fellow developers. I am taking a tutorial on Node.js and developed an app with Express, MongoDB atlas, etc. I used Passport-Google OAuth 2.0 for the login. Everything works well on my local machine, but it is giving me error when I deployed to Heroku. The error log is shown in the attached photo. When I run "heroku local web" on my terminal, it works fine, too. I've looked almost everywhere for solution, and tried many things; but none worked. Please, I need any help I can get to resolve this. Thank you. Please, I apologize for the poor quality image
|
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by afuye(m): 9:39am On Sep 02, 2020 |
Lemme see the script you ran. I hope u didn't use nodemon in production. ekrizz: |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 10:28am On Sep 02, 2020 |
afuye: No, I only used it in development. This is the link to my repo github(dot)com/OkekeChristian24/share-your-thought-app Thanks for your help |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 12:57pm On Sep 02, 2020 |
Please, guys don't just view the post and pass. I really need to make this app work. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by cixak95211: 2:21pm On Sep 02, 2020 |
Debugging itself is an art that has to be learned. The crashalytics gave you a file where the error is contained. I can help you but first you must help yourself. step 1. Login to heroku bash and step 2. "cat" that file and read the log, to understand why the error happened Then come back and report what you discovered. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by cixak95211: 2:34pm On Sep 02, 2020 |
|
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 5:35pm On Sep 02, 2020 |
cixak95211: God bless you for your help, boss. As you instructed, I did the "cat" of the strategy.js file as pointed out by the logger. First and second pictures shows the code (in Heroku CLI and Brackets editor, respectively) that triggered the error. I don't know why it is so because the Client ID was set as shown by the third to the last pictures. 3rd picture is the config.env file, the 4th picture shows as used in Passport-Google strategy, and the fifth picture shows it as Heroku config var. I still need your input. Thanks |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 5:35pm On Sep 02, 2020 |
cixak95211: This is the fifth picture
|
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 5:38pm On Sep 02, 2020 |
cixak95211: I've made corrections for the errors you pointed out. I still don't know much about Morgan. I guess I'll leave it for now. Let me redeploy and see. Thank you once again |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 7:17pm On Sep 02, 2020 |
Finally, I've resolved it. I added the Google client ID and secret to Heroku config vars, and it worked. Thank you. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 7:19pm On Sep 02, 2020 |
cixak95211: Thank you, boss, for your help. You're the real MVP. I'll like you to mentor me Node.js. I'm actually good with PHP, but still picking up on Node.js |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by cixak95211: 8:39pm On Sep 02, 2020 |
ekrizz: See you solved it, great! I was kinda bogged down with work and couldn't come online. I rechecked the codebase and see you cleaned up a bit. At least, that makes for improvement. One step at a time. If you have free internet, i'll like you to very much watch other contents on debugging, cos when you get to working in a production environment, you'll spend most of your time debugging "other people's errors" and those you created yourself. As per the mentoring, we'll see how it goes. I am always bogged down with work, but if you do run into issues, just let me know. Trust me, i'll not solve them for you, i'll just tell you what to do and you'll have to solve it yourself [to learn]. Cheers. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 7:15am On Sep 03, 2020 |
cixak95211: I appreciate, boss. I'd really like you to point out some resources on debugging codes (especially YouTube videos or ebooks) if possible. I have always known that it's better to teach one how to fish rather than giving him fish, so I would love it if you give directions on what to do just like you did above. Let me send you a PM. I don't know if your mail works, mine do. Thank you. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by cixak95211: 7:50am On Sep 03, 2020 |
ekrizz: Nah, that's a burner email. I guess if you use the follow button, we'll be able to exchange comms pretty effectively. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by ekrizz(m): 9:45am On Sep 03, 2020 |
cixak95211: Okay, boss. I just clicked the follow button. |
Re: Help With Node.js App Deployment To Heroku (Solved!!!) by HassieMalcomson(f): 10:31am On Dec 18, 2022 |
It sounds great that you have solved it but I think newbies can also contact to Heroku support in case of such issues. If I share my experience, I have been using Heroku for years and it was an outstanding experience. I was a big fan of the free-tier programs of Heroku but recently, this app deployment platform just changed its policy and there is no freemium plan anymore. Therefore, I left Heroku this year and chose Back4App for my Node.js app deployment tasks. This platform still has freemium plans and services and I don't need to insert my credit card details in this regard. Hereof, this guide https://blog.back4app.com/how-to-deploy-node-js-application/ confers you with all details about deploying a Node.js application by using the Back4App platform. This guide allows you to proceed with web hosting and database with ParseJS. Luckily, the free plan of this cloud vendor permits you following features: - 25k requests - 250 MB data storage - 1 GB transfer - 1 GB file storage |
(1) (Reply)
Advice A Newbie Venturing Into Tech / Nigerian Employers Always Think They Are Doing You A Favor / Error: No Error
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 40 |