JavaScript Error in logs: evaluating this.get("dropDownContent")

AI-generated summary

A user reported a JavaScript error in Discourse 1.2.0.beta4 occurring on mobile devices: TypeError: undefined is not an object (evaluating 'this.get("dropDownContent").forEach'). The error appeared while viewing a topic with the Spoiler Alert! plugin installed. eviltrout acknowledged the issue, noting that while the dropdown content should always exist, they implemented a defensive check to prevent the error in the future. When asked if further logging was needed to find the root cause, the thread was closed by sam after noting the error had not been seen in logs for a long time.

Discourse 1.2.0.beta4 - version 3cea85e09a5a86d7a965fb2ffd8b132659b79db0
The only extra plugin is Spoiler Alert!.

###Info
TypeError: undefined is not an object (evaluating ‘this.get(“dropDownContent”).forEach’)
Url: http://example.com/assets/vendor-0dbc6e71b0ee5428574e3562afe91ef1.js
Line: 5
Column: 19955
Window Location: http://example.com/t/example/66143/7

###Env

HTTP_HOST: example.com
REQUEST_URI: /logs/report_js_error
REQUEST_METHOD: POST
HTTP_USER_AGENT: Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/5.1.42378 Mobile/12B440 Safari/600.1.4
HTTP_ACCEPT: */*
HTTP_REFERER: http://example.com/t/example/66143/7

params:
  message: TypeError: undefined is not an object (evaluating 'this.get("dropDownContent").forEach')
Url: http://
  url: http://example.com/assets/vendor-0dbc6e71b0ee5428574e3562afe91ef1.js
  line: 5
  column: 19955
  window_location: http://example.com/t/example/66143/7

I’m actually not sure how this could be caused since both of the cases where we use the dropdown button should always have content.

Still, it’s safer to check for it when rendering so I committed this defensively:

https://github.com/discourse/discourse/commit/e4e239c159bdf4973c3710d1fa16bf585d4d789c

I wouldn’t be surprised if there is a root cause out there still to track down but it should prevent errors.

3 curtidas

Is there anything extra that needs to be logged / put in to help track down the possible extra root cause on this one?

Have not seen this in the logs in a long time, closing.