TypeError: Converting circular structure to JSON –> starting at object with constructor ‘ClientRequest’

First of all nest.js provides you HttpService out of the box that you may inject it through DI:
https://docs.nestjs.com/techniques/http-module

Second – you are trying to store whole response object which is complex data structure and contains circular dependencies as it stated in error message (TypeError: Converting circular structure to JSON)

What you should do is either you map the data you need instead of storing whole circular object,

or you should look up to some libs that could parse circular json: https://www.npmjs.com/package/flatted

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)