Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Converting circular structure to JSON --> starting at object with constructor 'TLSSocket' #6388

Open
testinghere57564 opened this issue May 10, 2024 · 0 comments

Comments

@testinghere57564
Copy link

Describe the bug

Due to the fact that Axios does not support some kinds of proxies, tunneling(HTPP OVER HTPPS idk), I don’t remember, I had to use such a crutch
const { HttpsProxyAgent } = require('https-proxy-agent');

const agent = new HttpsProxyAgent(https://${proxyUsername}:${proxyPassword}@${proxyHost}:${proxyPort});

const axiosOptions = {
httpsAgent: agent,

There were no such errors before this little change. There are no circular references in my code. This does not happen immediately, the code works for some time. Judging by the log, the error is somewhere inside the module
I send a lot of requests in my application

node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'TLSSocket'
| property 'parser' -> object with constructor 'HTTPParser'
--- property 'socket' closes the circle
at stringify ()
at stringifySafely (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:1435:37)
at Object.transformRequest (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:1495:14)
at transform (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:1921:15)
at Object.forEach (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:282:10)
at Object.transformData (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:1920:11)
at Axios.dispatchRequest (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:3611:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Axios.request (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:3871:14)
at Axios.request (E:\Users\nazar\Desktop\work\docker\node_modules\axios\dist\node\axios.cjs:3876:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

To Reproduce

No response

Code snippet

No response

Expected behavior

No response

Axios Version

1.6.8

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

Node.js v21.7.3

OS

No response

Additional Library Versions

"name": "https-proxy-agent",
  "version": "7.0.4",

Additional context/Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant