Skip to content

rst-versions footer cannot be expanded when using sphinx_rtd_theme #4132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Coconutcoo opened this issue May 23, 2018 · 17 comments
Closed

rst-versions footer cannot be expanded when using sphinx_rtd_theme #4132

Coconutcoo opened this issue May 23, 2018 · 17 comments
Assignees
Labels
Bug A bug

Comments

@Coconutcoo
Copy link

Coconutcoo commented May 23, 2018

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.

@stsewd stsewd added the Bug A bug label May 23, 2018
@stsewd
Copy link
Member

stsewd commented May 23, 2018

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.

@Coconutcoo
Copy link
Author

Coconutcoo commented May 23, 2018

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.

@dillonsvincent
Copy link

dillonsvincent commented May 23, 2018

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

@davidfischer
Copy link
Contributor

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

@tylerbutler
Copy link

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

@tylerbutler
Copy link

Could this be related to #3925?

@tylerbutler
Copy link

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

@davidfischer davidfischer self-assigned this May 23, 2018
@LewisSmallwood
Copy link

LewisSmallwood commented May 23, 2018

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).

@davidfischer
Copy link
Contributor

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.

@davidfischer
Copy link
Contributor

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

@dillonsvincent
Copy link

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

@davidfischer
Copy link
Contributor

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

No

@davidfischer
Copy link
Contributor

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).

@dillonsvincent
Copy link

Looks to be resolved for me after a cache dump

@davidfischer
Copy link
Contributor

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

I'm glad we got this sorted out.

@gasman
Copy link

gasman commented May 31, 2018

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

@stsewd
Copy link
Member

stsewd commented May 31, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

7 participants