question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Converting circular structure to JSON

See original GitHub issue

Describe the bug

When using the DiscussionEmbed component this error is generated:

Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'ReactCompositeComponentWrapper'
    |     property '_instance' -> object with constructor 'App'
    --- property '_reactInternalInstance' closes the circle
    at JSON.stringify (<anonymous>)
    at b.Channel.h.sendMessage (embed.js:44)
    at e.<anonymous> (embed.js:45)
    at e.<anonymous> (embed.js:44)
    at e.<anonymous> (embed.js:44)
    at m (embed.js:44)
    at e.trigger (embed.js:44)
    at e.<anonymous> (embed.js:44)
    at m (embed.js:44)
    at b.Channel.trigger (embed.js:44)

It appears that embed.js is trying to stringify the config to use sendMessage, which includes a reference to the DIV container for the discussion, but that includes react references in it which are circular.

To Reproduce

Steps to reproduce the behavior:

  1. Clone this repo
  2. npm i && npm run build:example && npm start
  3. Navigate to examples, go to an article with a discussion
  4. See error in console

Expected behavior

No error

Specifications:

I assume it’d happen on a few platforms but mine specifically are:

  • OS: MacOS 10.15.7
  • Package version: latest
  • Node version: 12
  • Browser: Chrome 87

Additional context

Not sure if it’s an issue with this package or disqus’s embed.js no longer playing nice with react, either way it needs to be solved by disqus.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
tterbcommented, Jan 14, 2021

The fix just went out, so I would expect that you should stop seeing these issues once the caches clear. I’m going to leave this issue open for the next couple of days to make sure the problem doesn’t persist for anyone and then I’ll close it out.

2reactions
tterbcommented, Jan 4, 2021

I’ve made the team aware of this issue and we’re going to try to track down the cause ASAP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Converting circular structure to JSON - Stack ...
It means that the object you pass in the request (I guess it is pagedoc ) has a circular reference, something like: var...
Read more >
Converting Circular Structure to JSON - Career Karma
JSON does not support object references, so trying to stringify a JSON object that references itself will result in a typeerror. It is...
Read more >
TypeError: Converting circular structure to JSON in JS
The "Converting circular structure to JSON" error occurs when we pass an object that contains circular references to the JSON.stringify() method. To solve...
Read more >
converting circular structure to json --> starting at object with ...
The JSON.stringify method does not support circular references, so we have to remove them before converting the object to JSON. If you spot...
Read more >
query* causes TypeError: Converting circular structure to JSON
The error seems to happen when HTML elements are passed to expect as a value to be compared. When an assertion fails jest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found