[x] I have thoroughly read and understand The Odin Project Contributing Guide
[x] The title of this issue follows the Bug: brief description of bug format, e.g. Bug: Lesson complete button does not update on click
[x] I would like to be assigned this issue to work on it
1. Description of the Bug:
In the NodeJS Course and lesson "Authentication Basics" the tutorial asks you to install Mongoose to access mongoDB data to practice authentication. Mongoose versions >= 7.0 no longer accept callbacks rendering the following image unable to run in the tutorial.
Follow all steps down until you reach the following header: "Function one : setting up the LocalStrategy"
The issue is found at "Function one : setting up the LocalStrategy", however it was not noticed until reaching the "Log in form" section
Run your code on a localhost server to see callstack errors
You should see the following error: MongooseError: Model.findOne() no longer accepts a callback at Function.findOne
3. Expected Behavior:
the User.findOne({ username: username }, (err, user) => {} should run without issues
4. Desktop/Device:
Device: Macbook Pro Mid-2015
OS: MacOS
Browser: Chrome
5. Additional Information:
I have found the following solutions to work well form stack overflow. There is a good thread about it here.
The current options talked about involve the following work-arounds:
1) uninstalling mongoose and rolling it back to 6.10.0: npm uninstall mongoose npm install mongoose@6.10.0, and
2) running a then/catch clause such as: myModel.find({}).then((res) => { //if succeded do this block of code }).catch((err) => { //catch error });
3) They do talk about running a .exec() function with the callback, but I did not have luck with this.
4) I'd suggest either editing the tutorial for this lesson to either installing the precise mongoose package and going over why, or adding solution 2 from this list as the acceptable way to run the screenshot mentioned above.
5) I have not gone back to look at the previous lessons to see if this issue persists with them as well, but this might require a larger change across multiple lessons.
[x] I have thoroughly read and understand The Odin Project Contributing Guide [x] The title of this issue follows the
Bug: brief description of bug
format, e.g.Bug: Lesson complete button does not update on click
[x] I would like to be assigned this issue to work on it1. Description of the Bug: In the NodeJS Course and lesson "Authentication Basics" the tutorial asks you to install Mongoose to access mongoDB data to practice authentication. Mongoose versions >= 7.0 no longer accept callbacks rendering the following image unable to run in the tutorial.
2. How To Reproduce:
MongooseError: Model.findOne() no longer accepts a callback at Function.findOne
3. Expected Behavior:
User.findOne({ username: username }, (err, user) => {}
should run without issues4. Desktop/Device:
5. Additional Information:
The current options talked about involve the following work-arounds: 1) uninstalling mongoose and rolling it back to 6.10.0:
npm uninstall mongoose npm install mongoose@6.10.0
, and2) running a then/catch clause such as:
myModel.find({}).then((res) => { //if succeded do this block of code }).catch((err) => { //catch error });
3) They do talk about running a .exec() function with the callback, but I did not have luck with this.
4) I'd suggest either editing the tutorial for this lesson to either installing the precise mongoose package and going over why, or adding solution 2 from this list as the acceptable way to run the screenshot mentioned above.
5) I have not gone back to look at the previous lessons to see if this issue persists with them as well, but this might require a larger change across multiple lessons.