Giter Club home page Giter Club logo

Comments (3)

kgathi2 avatar kgathi2 commented on August 27, 2024

Not sure why , but this behaviour is intermittent. Now checking my tests in my app and all are passing where i expect the error. Using the below bring error on and off.

{
  "data": {
    "id": "1677066013",
    "type": "session",
    "attributes": {
      "user": 1,
      "user_name": "qanisa",
      "user_confirmed": true,
      "ctas": {
        "share_app": "pending",
        "create_apps": "pending",
        "use_sandbox": "done",
        "create_integrations": "pending"
      }
    },
    "relationships": {
      "workspaces": {
        "data": [{ "id": "1", "type": "workspace" }],
        "meta": { "total": 1 },
        "links": { "related": "https://example.com/workspaces" }
      },
      "messages": {
        "data": [{ "id": "1", "type": "message" }],
        "meta": { "total": 1 },
        "links": { "related": "https://example.com/messages" }
      },
      "received_invites": {
        "data": [],
        "meta": { "total": 0 },
        "links": { "related": "https://example.com/invites" }
      },
      "sent_invites": {
        "data": [],
        "meta": { "total": 0 },
        "links": { "related": "https://example.com/invites" }
      },
      "user": {
        "data": { "id": "1", "type": "user" },
        "links": { "self": "https://example.com/users/1" }
      }
    },
    "links": { "self": "https://example.com/auth/user" }
  },
  "included": [
    {
      "id": "1",
      "type": "workspace",
      "attributes": {
        "name": "qanisa",
        "signup_voucher_id": null,
        "wallet_balance": "0.0",
        "voucher_balance": "0.0",
        "settings": null
      },
      "relationships": {
        "memberships": {
          "data": [{ "id": "1", "type": "membership" }],
          "links": { "related": "https://example.com/memberships" }
        },
        "users": {
          "data": [{ "id": "1", "type": "user" }],
          "links": { "related": "https://example.com/users" }
        },
        "invites": {
          "data": [],
          "links": { "related": "https://example.com/invites" }
        }
      },
      "links": { "self": "https://example.com/workspaces/1" }
    },
    {
      "id": "1",
      "type": "message",
      "attributes": { "body": null, "status": "unread", "category": "devise" },
      "relationships": { "user": { "data": { "id": "1", "type": "user" } } },
      "links": { "self": "https://example.com/messages/1" }
    },
    {
      "id": "1",
      "type": "user",
      "attributes": {
        "email": "[email protected]",
        "name": "qanisa",
        "mobile_no": null,
        "invitation_limit": 5,
        "unconfirmed_email": null,
        "email_confirmed": true
      },
      "relationships": {
        "memberships": {
          "data": [{ "id": "1", "type": "membership" }],
          "links": { "related": "https://example.com/memberships" }
        },
        "workspaces": {
          "data": [{ "id": "1", "type": "workspace" }],
          "links": { "related": "https://example.com/workspaces" }
        },
        "received_invites": {
          "data": [],
          "links": { "related": "https://example.com/invites" }
        },
        "sent_invites": {
          "data": [],
          "links": { "related": "https://example.com/invites" }
        },
        "messages": {
          "data": [{ "id": "1", "type": "message" }],
          "links": { "related": "https://example.com/messages" }
        }
      },
      "links": { "self": "https://example.com/users/1" }
    }
  ]
}

Any clue what's up?

from jsona.

kgathi2 avatar kgathi2 commented on August 27, 2024

https://codedamn.com/news/javascript/how-to-fix-typeerror-converting-circular-structure-to-json-in-js Seems its a JSON.Stringify() error.

from jsona.

olosegres avatar olosegres commented on August 27, 2024

Hi,
Serializing via JSON.stringify is not supported for objects with circular relationships.
You need to serialize it using jsona.serialize({ stuff, includeNames }) first, then you can serialize the result using JSON.stringify.

Similar issue #3

from jsona.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.