sometimes for a brief minute i can pass some challanges however i never get the code saying its connected and i get other errors in the console which i cant follow. then i go back to the first challange and it fails again saying not connected to DB:
Here is link
i have whitelisted all ips
i have double checked the login username / password: testUser / admin123
Your code so far
console log errors such as:
(node:1417) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1417) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0.
thanks for reply. i really wanna keep learning!
i dont belive im behind a firewall however that didnt cross my mind so i will now try and confirm that 100%
i have manged to pass this challenge after randonly clicking for abit however i go back to it 5minutes later no changes to the code and again it doesnt pass. this leads me to belive it is connection issues rather than anything else.
Hi, sorry for the slow reply life gets in the way sometimes.
Today i started again got to the third challenge before anything broke which is normal, when i atempted to go back again the time out stayed however when i made another one from stratch it passed straght away everytime so i figure i must be connecting to the db fine, the timeout is throwing me however.
on the third challenge i went though line by line and figured out where the error is occouring.
This is my current atempt:
the error message is:
// running tests
Creating and saving a db item should succeed (Test timed out)
// tests completed
now im not 100% sure if im right but all i can see by testing line by line the timeout occours when i put
done(null , data); into the if statement like so
if(err) return done(err);
done(null , data);
AND uncomment the data. so i figure either nothing is being passed as data or what is being passed cannot be processed by the done function causing the timeout
as to why when i comment out all of this code so its in a the state which passed the previous challenges and try and pass the previous challenges again it still has the same timeout error untill i create a new glitch project im not sure but hopefully i can get past this challenge above and it wont be a reoccouring problem.
Im sorry i havnt seen the ‘run the tests’ in any part of glitch so far so i dont know if im understanding correctly, however when i add those lines in im getting the same timeout error when i try and submit the url.
the node console says:
2 // this is from the console.log testing to see if db has connected
Your app is listening on port 3000
Edit: ok ive found a second console which must be the node console but i still dont see a way to run the tests
If you added both of the console.log statements where I specified in your current project, you should see something like the following when you submit the above url. If not, then you will need to check your browser’s console to see if anything gets displayed there when you submit the url. I have forked your Glitch project and only changed to my own MONGO_URI and can pass the Create and Save a Record of a Model challenge without any problem.
I suggest you clear the browser console before submitting the url. Also, you still have not added the console.log statements like I said in one of my previous posts. That is probably why you are not seeing anything in the Node console.
Please clear the browser console first before submitting the url and taking the screenshot. If you are still seeing those errors in the browser console after doing so, then there is something else unrelated going on here.