MongoDB and Mongoose - Create a Model

Tell us what’s happening:

My Code:

const personSchema = new mongoose.Schema({
  name: { type: String, required: true },
  age: { type: Number },
  favoriteFoods: { type: [String] },
});

const Person = mongoose.model("Person", personSchema);

Getting this error:

[Error: Cannot read properties of undefined (reading ‘modelName’)]

First test went without a hitch.
Tried discarding all changes and redoing the first and second challenge, same error.
Tried copying the repo again, same error.
I did fork it before copying, but it won’t let me copy it directly.

Any help is appreciated, thanks

###Your project link(s)

solution: http://localhost:3000

Your browser information:

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

Challenge Information:

MongoDB and Mongoose - Create a Model

When you run the tests, are you getting any console messages or entries in your database?

I just ran the test again to check and it passed.
Didn’t change anything since I posted on the forum. Glad you asked, or I wouldn’t have tried again for a while.

I guess, if your code doesn’t pass and you know it should, step away for a day and try again.