Bugs

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

- Buffering timed out after 10000ms : means we imported the model file but we didnt import the

connection file

we explained it in D:\Courses\Route\Eng ahmed abd alm3aty\week 6\mongCon

- TypeError: Converting circular structure to JSON

--> starting at object with constructor 'MongoClient'

| property 's' -> object with constructor 'Object'

| property 'sessionPool' -> object with constructor 'ServerSessionPool'

means we didnt use await in our controller so the router goes and goes without waiting the query

- findbyidandupdate doesnt accept to return the result of that query cuz thats mean return the old data
before it was changed although we can do it by other queries, but we can do it here by adding
{new:true} to the query and means return the new value after update

- MissingSchemaError: Schema hasn't been registered for model : means the we used populate, so we
edited the refrence of our "forExample" notes table to users table at the notes.model.js----- BUT WE
DIDNT ADD S IN THE USER TABLE "USER"

- MongoServerError: Cannot do exclusion on field id in inclusion projection : maans their is something


wrong with the id field while doing projection

- Error: data and salt arguments required : means there is something with the hash variables, mostly
there is something from the postman or the front end

- err = new Error(message); Error: No recipients defined :- This kind of error occurs when value
assigned to key to in object given to sendMail method is empty or not string. As we see it means that
something wrong happens and you don't get the same data on the server-side, as you sent in client.

- Cannot set headers after they are sent to the client : means there is something with your parameters
like not sending two arguments although your function has three params

- if youre having html file as response, look if you sent a response or did next() ?

- "StackTrace": "MulterError: Unexpected field\n at wrappedFileFilter : means we mentioning a


wrong field at our code like we used postman to upolad pic in field called img but we name it in our code
image instead of img

OR
you uploaded more than single file but you used single object that are assosiated with single file only

- This is uncaughtException tell your there is a problem: TypeError: storage._handleFile is not a function

means look at the storage handler function or object, i sent here object to another object, they both do
the same thing, so compiler her got confused, why you mentioned that object while you have an object
do the same jops???

const uploadMulter1 = multer({

storage: diskStorage,

fileFilter,

});

const uploadMulter = multer({ storage: uploadMulter1 });

- failed custom validation because Cannot read properties of undefined (reading 'presence'): means you
used required only without paranthese in the validation schema

- Error: data and salt arguments required at Object.hashSync :::: means look at your argumnets cuz they
maybe empty

You might also like