-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: display of search results is broken on PR builds #10714
Comments
Currently, we are not indexing files when building from pull requests due to the processing cost. However, we've talked about enabling this feature and it may happen in the future. I think we have an exact issue for this, but I didn't find it / cc @stsewd |
I looked through the open issues first but couldn't find a match, so I reported this issue here. |
Server side search is not enabled for PR builds, but the normal Sphinx search should work, so this is a bug. |
We are moving away from the "auto injecting our search" concept (see readthedocs/addons#72) and leaning more towards using our search via the addons. I don't think we will solve this issue and it can probably be closed as not planned. |
I am seeing this same behavior ("undefined" breaking search result links) in non-PR builds. It seems to depend on the specific query. Examples:
At least in my case, the broken links are caused by (my docs/requirements.txt) trying to use Sphinx 7.2.x with sphinx-rtd-theme 1.3.x. There was a breaking change in the Sphinx 7.2 searchtools.js that requires |
It seems you should upgrade the Read the Docs Sphinx theme to 2.x. Can you do that and let us know if this fixes the problem? |
Yes, upgrading to sphinx-rtd-theme 2.0 solved the broken search result links for my project:
At the time the original issue here was reported, sphinx-rtd-theme 2.0 hadn't yet been released. It's likely that release on 2023-11-27 solved the specific bug reported here, for anyone not pinning docs requirements. (So this should maybe be closed fixed rather than not planned.) Additional info for anyone else still seeing broken Read the Docs search result links with "undefined" in the URLs, perhaps using other Sphinx themes or custom layouts:
|
I'm happy that |
First, big thanks! for providing this doc building & hosting service which we use for the Agda programming language.
I noticed that the display of search results does not fully work on PR builds of the documentation. E.g. here I am searching for word "instance" in the build for PR agda/agda#6821:
https://agda--6821.org.readthedocs.build/en/6821/search.html?q=instance&check_keywords=yes&area=default
Using Google Chrome, this only displays the sections which contain the hits but not the hits themselves.
Turning on the JavaScript Console, I see errors thrown in
seachtools.js
:It appears that the URLs are broken because some
undefined
sneaked in. Consequently, thehtmlToText
getsnull
rather than the file content and crashes.Following the exception into the code of
searchtools.js
I see code that builds the URL (requestUrl
) by concatenation of some strings.Likely, one of these strings is
undefined
in PR-builds when it should be empty.E.g. the valid link is https://agda--6821.org.readthedocs.build/en/6821/tools/command-line-options.html whereas GET tries https://agda--6821.org.readthedocs.build/en/6821/undefinedtools/command-line-options.html .
In the regular build everything works as expected, so the output of this query is what I expect also on the PR build:
https://agda.readthedocs.io/en/latest/search.html?q=instance&check_keywords=yes&area=default
The text was updated successfully, but these errors were encountered: