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

Axios-debug tries to stringify circular JSON #1

Open
dschuessler opened this issue Feb 29, 2020 · 0 comments
Open

Axios-debug tries to stringify circular JSON #1

dschuessler opened this issue Feb 29, 2020 · 0 comments

Comments

@dschuessler
Copy link

I used axios-debug in an integration test and got this:

Request:
{
    "url": "http://localhost:8080/api/user/login/",
    "method": "post",
    "data": {
        "email": "[email protected]",
        "password": "***"
    },
    "headers": {
        "common": {
            "Accept": "application/json, text/plain, */*"
        },
        "delete": {},
        "get": {},
        "head": {},
        "post": {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        "put": {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        "patch": {
            "Content-Type": "application/x-www-form-urlencoded"
        }
    },
    "transformRequest": [
        null
    ],
    "transformResponse": [
        null
    ],
    "timeout": 0,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1
}
Response:
  1) "before all" hook in "{root}"

  0 passing (374ms)
  1 failing

  1) "before all" hook in "{root}":
     TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'ClientRequest'
    |     property 'socket' -> object with constructor 'Socket'
    --- property '_httpMessage' closes the circle
      at JSON.stringify (<anonymous>)
      at Object.debug (node_modules/axios-debug/lib/index.js:4:67)
      at /path/to/project/e2e-test/node_modules/axios-debug/lib/index.js:31:9
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

It seems like axios-debug does not expect circular JSON at certain points. Let me know if you are interested in more information:

axios: 0.19.2
axios-debug: 0.0.4
node: 13.7.0

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