nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
588 stars 319 forks source link

Catch and ignore Disqus errors #3134

Open sentry-io[bot] opened 3 years ago

sentry-io[bot] commented 3 years ago

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)
yaofeng-wang commented 3 years ago

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.

Noob-No-1 commented 2 months ago

Hi, the UI of the web site is changed, the described issue does not appear anymore