nusmods icon indicating copy to clipboard operation
nusmods copied to clipboard

Catch and ignore Disqus errors

Open sentry[bot] opened this issue 5 years ago • 2 comments

Disqus's component is rather buggy, causing quite a few errors. We should try to catch Disqus errors and render an error component -- maybe wrap the Disqus component in an ErrorBoundary?

Steps to reproduce

  1. Open a module's page, e.g. https://nusmods.com/modules/PS3249/singapores-foreign-policy
  2. In the Disqus widget, click "NUSMods", located to the left of "Disqus Privacy Policy". image
  3. An error will be logged to the console, and the page will freeze.

Context

Sentry Issue: V3-3CJ (internal only; external link)

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'HTMLDivElement'
    |     property '__reactFiber$6cpk6wi09gs' -> object with constructor 'Du'
    --- property 'stateNode' closes the circle
  at JSON.stringify (<anonymous>)
  at b.Channel.h.sendMessage (/embed.js:44:18771)
  at e.<anonymous> (/embed.js:45:2483)
  at e.<anonymous> (/embed.js:44:16158)
  at e.<anonymous> (/embed.js:44:15677)
...
(7 additional frame(s) were not displayed)

sentry[bot] avatar Jan 03 '21 02:01 sentry[bot]

Hi, following steps 1 and 2 does result in errors in the console. However, the errors are not related to TypeError: Converting circular structure to JSON. Also, the page did not freeze.

yaofeng-wang avatar Oct 16 '21 01:10 yaofeng-wang