Tell us what’s happening:
I completed the project locally on VS Code and successfully ran all 5 tests, then committed the changes to the GitHub repository, then cloned the repo to replit and it crashes.
I installed nodemon mongoose and node-fetch in replit already still nothing. Any solutions are highly appreciated
Your project link(s)
GitHub repository: GitHub - Dav3-cloud/Stock_Price_Checker_Freecodecamp
Your browser information:
User Agent is:
Google Chrome for Mac
Challenge: Stock Price Checker
Link to the challenge:
Do you have a link to the replit? Are you getting any error messages?
This is the link to replit: https://replit.com/@DavidSanchez40/StockPriceCheckerFreecodecamp#README.md
The error that I am getting is this: unpromise rejection warning
I’m not sure how to diagnose this because I don’t have access to your env variables so I can’t really check it out.
I will say that it seems to hit your endpoint and I gets into trouble when it is trying to hit the db. I would put in some console.log statements to try and narrow down where the problem is.
The error you are getting usually means that a promise was rejected and you aren’t handling it. You are using
async/await so those should probably be wrapped in
try/catch blocks so you can catch the error being thrown.
That being really the question. I know that replit is not allowing .env files anymore and now is using the const mySecret to save the database access, api keys, etc.
I will look for a way to fix this with what you suggested.
Thanks a lot for the help!!
Yeah, I seem to remember that replit had their own way of doing that, that you didn’t enter them into a .env file but enter them into their interface. You still use them in the code the same way, you just store them differently.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.