Disqus comments throws error in a Gatsby site

I am using a gatsby plugin gatsby-plugin-disqus(latest version) to add comments in my gatsby site. It worked previously but now it throws error and comments do not load. Seems like there's circular reference but I don't know what is causing it.

Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'HTMLDivElement'
|     property '__reactInternalInstance$ijgm46blrc' -> object with constructor 'FiberNode'
--- property 'stateNode' 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)
at embed.js:44

My disqus config looks like:

const disqusConfig = {
  identifier: "/my-post-title-slug/"
  title: "my post title"
  url: "https://somesite.com/blog/my-post-title-slug/"
}

And i render it like this:

import { Disqus } from 'gatsby-plugin-disqus';
// ....
<Disqus config={disqusConfig} />

I am not sure what is causing this problem. I tried to use previous versions of the plugin but i get the same result.

Please let me know what i am missing here. Thanks.



Read more here: https://stackoverflow.com/questions/65700415/disqus-comments-throws-error-in-a-gatsby-site

Content Attribution

This content was originally published by Kishor at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: