Exercise Tracker Changes

Tell us what’s happening:
I had troubles with the task, so I had to seek for answers on the web, where I found the code that I’ve used as the base for the solution for the task. However, with recent changes, it seems like there are different requirements, I went along updating the code, however now the app would just crash on every ‘pass attempt’.
Here’s the code used:

Please kindly assist
Your project link(s)

solution: https://boilerplate-project-exercisetracker.hulchenko.repl.co

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36.

Challenge: Exercise Tracker

Link to the challenge:

You didn’t mention your errors generated in the repl.it console:

TypeError: Cannot read property '_id' of undefined
    at /home/runner/boilerplate-project-exercisetracker/server.js:150:35

This is in your exercise posting route, which crashes your app and would cause subsequent failures. Examining the code in question:

_id: foundUser[0]._id,

indicates that you haven’t found that user, which means the id is not getting passed to the route like you think. So, add logging statements of the route inputs and responses and re-run the tests to make sure that the route is getting and sending the correct information.

Also, if you look at the browser console while running the tests, you’ll see a bunch of CORS errors. I’m not sure if those are real or are due to the app crashing, but you may need to check your CORS configuration as well.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.