Skip to content
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

Search not working in 1.2.0 in environments without web access #1434

Closed
tmct opened this issue Feb 8, 2023 · 18 comments
Closed

Search not working in 1.2.0 in environments without web access #1434

tmct opened this issue Feb 8, 2023 · 18 comments
Labels
Support Support question

Comments

@tmct
Copy link

tmct commented Feb 8, 2023

Problem

Hi,

When I upgrade to 1.2.0, the "search" feature stops working in airgapped environments. When a search is initiated, it "spins" but does not finish.

Also observed:

  1. on load, the webpage tries to access https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js upon load, and this fails in environments with no internet access, as expected
  2. "Uncaught ReferenceError: jQuery is not defined" happens when you initiate a search

Reproducible Project

Cannot share, sorry - but it shouldn't matter

Error Logs/Results

See above

Expected Results

Search completes as expected

Environment Info

  • Python Version: 3.8 and 3.9
  • Sphinx Version: 6.1.3
  • RTD Theme Version: 1.2.0
@tmct tmct added Bug A bug Needed: replication Bug replication is required labels Feb 8, 2023
@benjaoming
Copy link
Contributor

@tmct we forced the version of sphinxcontrib-jquery to exclude 3.0.0 because there were incoming reports that jQuery wasn't loaded in local builds because of an SRI integrity check. See: #1420

If you can force-feed pip sphinxcontrib-jquery==3.0.0, you should be able to serve an airgapped build.

This will be finally fixed by a new version of sphinxcontrib-jquery: sphinx-contrib/jquery#14

@tmct
Copy link
Author

tmct commented Feb 8, 2023

Thanks very much! I'll keep an eye on that sphinxcontrib-jquery change.

@benjaoming
Copy link
Contributor

@tmct you can also try reinstalling now, that should give you sphinxcontrib-jquery==4.1 which has resolved the issue generally.

@gherceg
Copy link

gherceg commented Mar 16, 2023

@benjaoming we are experiencing a similar issue, but after upgrading sphinxcontrib-jquery to 4.1 (with sphinx==6.1.3 and sphinx-rtd-theme==1.2), the "Uncaught ReferenceError: jQuery is not defined" error still occurs when using the search bar.

@benjaoming
Copy link
Contributor

@gherceg thanks for the feedback!! do you have a build log, a link to the documentation and/or a git repo that I can have a look at?

@gherceg
Copy link

gherceg commented Mar 16, 2023

Yeah of course. commcare-hq is the repository, and the docs are here, but notably that docs build is still running sphinxcontrib-jquery==2.0.0, with the same versions for sphinx and sphinx-rtd-theme mentioned above.

@benjaoming
Copy link
Contributor

benjaoming commented Mar 16, 2023

@gherceg ah! I recognize this issue. Default setups aren't affect by this: We removed html_theme_path from the injected default configuration for Sphinx projects on Read the Docs (because this setting breaks stuff), but very old instructions mentioned to define html_theme_path, so that's probably where you originally got it into your own conf.py. The setting unfortunately switches off the theme's ability to automatically enable the sphinxcontrib-jquery extension, so you either have to enable the extension manually or remove html_theme_path from conf.py. Since it's unnecessary to have this setting, you can just remove it as suggested in dimagi/commcare-hq#32760 👍

(after multiple edits: I think it makes sense now, but LMK if there's something unclear)

ThomasRuby added a commit to squirrel-prover/squirrel-prover that referenced this issue Oct 26, 2023
bpedersen2 added a commit to mlz-ictrl/nicos that referenced this issue Nov 2, 2023
see readthedocs/sphinx_rtd_theme#1434 (comment)
for details

Change-Id: I890ae6c9329fac3bc5f4f004c33b2386cd183557
Reviewed-on: https://forge.frm2.tum.de/review/c/frm2/nicos/nicos/+/32460
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de>
bpedersen2 added a commit to mlz-ictrl/nicos that referenced this issue Nov 2, 2023
see readthedocs/sphinx_rtd_theme#1434 (comment)
for details

Change-Id: I890ae6c9329fac3bc5f4f004c33b2386cd183557
Reviewed-on: https://forge.frm2.tum.de/review/c/frm2/nicos/nicos/+/32460
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de>
(cherry picked from commit d8e2eb9)
Reviewed-on: https://forge.frm2.tum.de/review/c/frm2/nicos/nicos/+/32461
nsoranzo added a commit to nsoranzo/galaxy that referenced this issue Apr 4, 2024
The `html_theme_path` option should not be used any more with
sphinx-rtd-theme since it switches off the theme's ability to
automatically enable the sphinxcontrib-jquery extension, i.e.
jQuery is not loaded in the web pages when building the docs with
Sphinx >=6.

xref: readthedocs/sphinx_rtd_theme#1434 (comment)

Also replace the deprecated `canonical_url` theme option with
Sphinx's `html_baseurl`.

xref: https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#confval-canonical_url
zwall-bp added a commit to osuosl/wiki that referenced this issue Jul 3, 2024
There is a documented issue where the deprecated variable, html_theme_path has caused the search feature to break. 

readthedocs/sphinx_rtd_theme#1434 (comment)
dliptai added a commit to ADACS-Australia/OzSTAR-User-Guide that referenced this issue Aug 1, 2024
see readthedocs/sphinx_rtd_theme#1434 (comment)
No longer need to define html_theme_path
@humitos
Copy link
Member

humitos commented Aug 12, 2024

Is this still an issue? If so, can you point us to a live project hitting this issue (or instructions to reproduce it) ?

@LGouellec
Copy link

Try https://lgouellec.github.io/streamiz/index.html, Search "Branch" in the search tab, it "spins" but does not finish. Same for any other words.

@humitos
Copy link
Member

humitos commented Aug 12, 2024

@LGouellec what version of the theme are you using? what's the version of Sphinx itself? Can you try using the latest version of the theme?

@LGouellec
Copy link

I tried the last one 2.0.0, but without effects

https://github.com/LGouellec/streamiz/blob/master/.github/workflows/gh-pages.yml

@humitos
Copy link
Member

humitos commented Aug 13, 2024

@LGouellec the error in the browser's console says: Uncaught ReferenceError: jQuery is not defined. So, I think 2.0.0 is not being installed correctly. What's the output of the build process? Is this one https://github.com/LGouellec/streamiz/actions/runs/10357412706/job/28669387744?

@humitos humitos added Support Support question and removed Bug A bug Needed: replication Bug replication is required labels Aug 13, 2024
@humitos
Copy link
Member

humitos commented Aug 13, 2024

I can't open that URL, AuthenticationFailed

@LGouellec
Copy link

0_build-and-deploy.txt

@humitos
Copy link
Member

humitos commented Aug 14, 2024

From that build output, everything looks correct to me:

2024-08-12T18:35:05.9826720Z   Downloading sphinx_rtd_theme-2.0.0-py2.py3-none-any.whl.metadata (4.4 kB)
2024-08-12T18:35:06.0110510Z   Downloading sphinxcontrib_jquery-4.1-py2.py3-none-any.whl.metadata (2.6 kB)

I'm not sure why it's not working. If you provide a minimal reproducible example, we can debug further. However, I still think it's a problem in your environment/configuration.

@humitos
Copy link
Member

humitos commented Aug 14, 2024

I notice that you don't have the theme added as an extension in https://github.com/LGouellec/streamiz/blob/master/docs/conf.py#L33 as our documentation mentions https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html. Can you try that?

@LGouellec
Copy link

@humitos ,

I have added the extension and now it works ! Thank you for your support.

@humitos humitos closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
eduble added a commit to drakkar-lig/walt-python-packages that referenced this issue Sep 30, 2024
Remove obsolete html_theme_path setting from doc/walt/doc/sphinx/conf.py.
This was causing the search function to fail, as described here:
readthedocs/sphinx_rtd_theme#1434
eduble added a commit to drakkar-lig/walt-python-packages that referenced this issue Oct 2, 2024
Remove obsolete html_theme_path setting from doc/walt/doc/sphinx/conf.py.
This was causing the search function to fail, as described here:
readthedocs/sphinx_rtd_theme#1434
eduble added a commit to drakkar-lig/walt-python-packages that referenced this issue Oct 3, 2024
Remove obsolete html_theme_path setting from doc/walt/doc/sphinx/conf.py.
This was causing the search function to fail, as described here:
readthedocs/sphinx_rtd_theme#1434
eduble added a commit to drakkar-lig/walt-python-packages that referenced this issue Oct 4, 2024
Remove obsolete html_theme_path setting from doc/walt/doc/sphinx/conf.py.
This was causing the search function to fail, as described here:
readthedocs/sphinx_rtd_theme#1434
eduble added a commit to drakkar-lig/walt-python-packages that referenced this issue Oct 9, 2024
Remove obsolete html_theme_path setting from doc/walt/doc/sphinx/conf.py.
This was causing the search function to fail, as described here:
readthedocs/sphinx_rtd_theme#1434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

5 participants