Readthedocs.org: rst-versions footer cannot be expanded when using sphinx_rtd_theme

Created on 23 May 2018  路  17Comments  路  Source: readthedocs/readthedocs.org

Details

Expected Result

When clicking the injected rst-versions footer image while using sphinx_rtd_theme, the footer should expand and show content.

Actual Result

Page load causes the DOM to crash with the following error:

Uncaught TypeError: Cannot read property 'enable' of undefined
    at HTMLDocument.<anonymous> ((index):288)
    at f (jquery-2.0.3.min.js:3)
    at Object.fireWith [as resolveWith] (jquery-2.0.3.min.js:3)
    at Function.ready (jquery-2.0.3.min.js:1)
    at HTMLDocument.ge (jquery-2.0.3.min.js:1)

Line 288 is a script added during the RTD build, that seems to be for the Sphinx RTD theme:

<script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
</script>

SphinxRtdTheme.Navigation is supposedly undefined, and SphinxRtdTheme contains only one element; StickyNav.
Removing the script, or replacing "Navigation" with "StickyNav" fixes this issue and allows the footer to be expanded as expected.

I wasn't really sure whether this was an issue to open here or on the sphinx theme's Github, but since building locally with this theme, the footer isn't injected, I think this is the correct place.

Bug

Most helpful comment

@gasman yeah, this was from yesterday, the team is working on that right now

All 17 comments

At first, I wasn't able to replicate this on your project, then I clear the cache and was able to replicate this. So, I think this is due to a recent update.

Should've clarified in the post what I've tried;

Clean install of Sphinx (sphinx-quickstart) and Alabaster theme, build on RTD, worked correctly.
Clean Sphinx install, RTD theme, build on RTD, did not work correctly.

Both of these had the same set of my .rst files and images, and with no other changes to the conf.py file than the html theme this issue arises.

I am also experiencing this issue, i'm not able to reproduce locally. This also disabled by sidebar menu from expanding, I assume because of the js error since the tree elements are in the DOM

@dillonsvincent, do you have a project url? It would really help to investigate.

@davidfischer I am seeing this on my project as well. URL is https://wopi.readthedocs.io/

Could this be related to #3925?

This bug also seems to break the 'hamburger' menu on mobile devices (or devices with a small viewport). Tapping it does nothing.

I believe it crashes jquery / disables the DOM as soon as the error occurs so any onclick events, etc don't get called (including toggling the hamburger and the versions menu).

Could this be related to #3925?

It definitely is.

There is a problem where Read the Docs was getting too clever trying to speed up docs by centralizing the theme JavaScript. However, it ran into problems with a version mismatch. There was supposed to be short term fix for this but it doesn't appear to be working correctly.

This looks like there was a problem building the static assets correctly in the last deploy. I should have this fixed relatively shortly.

@davidfischer https://atra.readthedocs.io/ https://github.com/dillonsvincent/docs
Are all effected sites going to need to rebuild after the fix?

Are all effected sites going to need to rebuild after the fix?

No

I believe this issue is resolved. I'm running a few tests but I believe this should be fixed. You may need to reload without cache (I'm working on that too).

Looks to be resolved for me after a cache dump

Yes, the static assets didn't get built correctly and old static assets were used.

I'm glad we got this sorted out.

I'm now seeing this error on http://docs.wagtail.io/en/v2.1/ - not sure when it started.

@gasman yeah, this was from yesterday, the team is working on that right now

Was this page helpful?
0 / 5 - 0 ratings