UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON - NodeJS

Viewed 272

I am working with nodejs and typescript. When trying to query my database it returns the following error:

UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON --> starting at object with constructor 'Query' | property '_timer' -> object with constructor 'Timer' --- property '_object' closes the circle at JSON.stringify () at stringify

enter image description here

This is my code.

 public async list (req: Request, res: Response) {
     const list = await pool.query('SELECT * FROM projects');

     res.json(list);
 }
0 Answers
Related