It seems that when I try to change the code any way it doesn’t pass the first 6 tests. I’ve been stuck on this for almost 2 weeks. I have no idea how I can fix it or what needs to be done. Any help is appreciated
Your project link(s)
solution: boilerplate-project-exercisetracker-1 - Replit
Your browser information:
User Agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/184.108.40.206 Safari/537.36
Challenge: Back End Development and APIs Projects - Exercise Tracker
Link to the challenge:
It seems when I edit it, it makes it fail the second test and it still doesn’t pass
I just had the first 6 tests past but, now for some reason the second one isn’t passing anymore again. I have no idea what could be wrong
I would suggest you install
nodemon and change the start script to use it instead of node. That way when the server crashes it will not auto restart and you can actually read the crash log (not sure who on the Replit team thought auto restarting a server that crashes and wiping the log was a good idea but it is just dumb).
It is crashing with
TypeError: Cannot read properties of null (reading 'toJSON')
req.query in the
/api/users/:_id/logs route. hint:
:id is a parameter, i.e.
As an aside, Line 63:
toDateString is a method you have to call it
There still seems to be an error. Even when I do that. I ran nodemon and there is still errors. I had 7 of the tests pass but then whenever I make any slight changes it then fails everything.
I don’t see nodemon in your project and you have a syntax error (line 67). If I add nodemon and fix the syntax error I get a new error. If I fix that I get the same error from before, your parameter is not named
userId. I’d suggest you log out
req.params in your routes.
req.body._id inside the
/api/users/:_id/exercises route, or just
req.body and look at it.
req.params.userId inside the
/api/users/:_id/logs route, or just
req.params and look at it.
I’ve tried fixing it but, it’s still giving the same error.
I see it says undefined, so I’ve fixed that part and now it’s the response return. I see the problem now. This post can be closed now.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.