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 button/field broken on local development build #1654

Closed
dstansby opened this issue Jan 17, 2024 · 7 comments · Fixed by #1660
Closed

Search button/field broken on local development build #1654

dstansby opened this issue Jan 17, 2024 · 7 comments · Fixed by #1660

Comments

@dstansby
Copy link
Contributor

dstansby commented Jan 17, 2024

With a local development build of the theme, searching appears to be broken. When I click on the search field nothing happens, where a search box should appear in the middle of the website. Pressing cmd+k does not work either, and instead opens the search bar of my browser.

I'm on current main (fff6837) and built the docs using nox -s docs. Not really sure what other debug info would be useful, but happy to help!

(I found this when trying to debug another search issue, but if I can't get search to work in a vanilla build then I don't have much hope tracking down my other issue 😄 )

@dstansby
Copy link
Contributor Author

I've managed to bisect this breaking back to b36c6d8 (from #1344)

@drammock
Copy link
Collaborator

can you check the browser console? It sounds like some JS is raising an error during page load, thus preventing the search-related JS from ever executing. I see that b36c6d8 included a new throw err line in the JS, so that strengthens my suspicion that the problem may actually be something related to the version switcher.

@dstansby
Copy link
Contributor Author

When I mouseover the search field in the console I get

Request for font "Noto Sans" blocked at visibility level 2 (requires 3)
[getOffsetParent.js:11:2](webpack://pydata_sphinx_theme/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js)

When I try clicking on the search field nothing else comes up.

@drammock
Copy link
Collaborator

and if you scroll back in the browser console, there are no errors thrown earlier (during page load) related to the version switcher? Does the version switcher look ok / work normally in the site?

@dstansby
Copy link
Contributor Author

There's this (sorry, can't work out how to copy/paste the text...) which points to line 352 which is inside the fetchVersionSwitcherJSON function:
Screenshot 2024-01-17 at 20 16 26

@drammock
Copy link
Collaborator

That looks like the culprit to me... Ah! OK sorry, I missed that you were using nox -s docs. I can reproduce. Can you try it with nox -s docs-live please? That works for me locally (version switcher works, and Ctrl+k also works).

I'm not saying we shouldn't try to fix this... but maybe with docs-live you can at least get back to the issue you were originally trying to debug

@dstansby
Copy link
Contributor Author

Yes, docs-live works fine. Would be nice to fix this though so static builds of third party docs have working search without needing to serve them live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants