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

[BUG] JS errors on Bokeh docs page #13789

Closed
cdeil opened this issue Mar 31, 2024 · 7 comments · Fixed by #13823
Closed

[BUG] JS errors on Bokeh docs page #13789

cdeil opened this issue Mar 31, 2024 · 7 comments · Fixed by #13823

Comments

@cdeil
Copy link
Contributor

cdeil commented Mar 31, 2024

Software versions

See your docs build

Browser name and version

Chrome Version 123.0.6312.59 (Official Build) (arm64)

Expected behavior

Docs page search field works

Observed behavior

Docs page search field in top right doesn't work.

Example code

Stack traceback or browser console output

custom.js?v=22a1fd09:11 Uncaught ReferenceError: $ is not defined
    at custom.js?v=22a1fd09:11:1
(anonymous) @ custom.js?v=22a1fd09:11
pydata-sphinx-theme.js:54 [PST]: Changed to light mode using the light theme.
pydata-sphinx-theme.js:570 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'classList')
    at T (pydata-sphinx-theme.js:570:5)
    at r (mixin.js:11:41)
    at pydata-sphinx-theme.js:584:1
T @ pydata-sphinx-theme.js:570
r @ mixin.js:11
(anonymous) @ pydata-sphinx-theme.js:584
await in (anonymous) (async)
c.a @ async module:49
937 @ pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae:1
c @ bootstrap:19
(anonymous) @ startup:4
(anonymous) @ pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae:1
pydata-sphinx-theme.js:200 Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
    at c (pydata-sphinx-theme.js:200:17)
    at pydata-sphinx-theme.js:237:19
c @ pydata-sphinx-theme.js:200
(anonymous) @ pydata-sphinx-theme.js:237

Screenshots

Screenshot 2024-03-31 at 10 15 29
@cdeil cdeil added the TRIAGE label Mar 31, 2024
@bryevdv
Copy link
Member

bryevdv commented Apr 1, 2024

This is some issue with the Sphinx theme, not Bokeh itself.

@choldgraf any thoughts on what could be going amiss (or who is the best person to ask these days)?

cc @tcmetzger

@bryevdv bryevdv added this to the 3.5 milestone Apr 1, 2024
@choldgraf
Copy link

I'd recommend opening an issue in the pydata-sphinx-theme repository in case it's a problem over there. It looks like the HTML structure has changed and the JS selector didn't change to accommodate it, but I haven't been following the development too closely so don't know where the problem may be

@bryevdv
Copy link
Member

bryevdv commented Apr 1, 2024

@mosc9575 before we make an issue over there, do you have any bandwidth for a quick look? Does this reproduce locally, and if so does a simple change like updating the theme version fix things?

@mosc9575
Copy link
Contributor

mosc9575 commented Apr 2, 2024

Only the search button on the start page is broken. The button works on other pages like first steps and gallery and I don't understand why. I also think that the posted JS error is unrelated, because it also appears on pages with working search button.

The error in the browser console comes from the version banner and I don't know how to fix it. See

// Display a version warning banner if necessary
$(document).ready(function () {
const randid = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
$.getJSON('/switcher.json?v=' + randid , function (data) {
// old versions have a unified latest/x.y.z, things are split starting with 3.0
if (BOKEH_CURRENT_VERSION != data[1].version) {
let msg
if (data.findIndex((elt) => elt.version == BOKEH_CURRENT_VERSION) < 0 ) {
msg = "DEVELOPMENT / PRE-RELEASE"
} else {
msg = "PREVIOUS RELEASE"
}
const content = $('<div class="version-alert">This page is documentation for a ' + msg + ' version. For the latest release, go to <a href="https://docs.bokeh.org/en/latest/">https://docs.bokeh.org/en/latest/</a></div>')
$('#banner').append(content);
}
})
})

I also build the docs on my local machine with pydata-sphinx-theme 0.15.2 and 0.15.3dev0 and I can't see if it works, because the search button is broken for local pages. There is an older issue 1654 which could be related.

@choldgraf
Copy link

Just noting that I believe version warning banners are now built into the theme, so you could try using that and see if that removes the error

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html#version-warning-banners

@cdeil
Copy link
Contributor Author

cdeil commented Apr 12, 2024

Still the same error. Re-open and close when it's fixed?

@bryevdv
Copy link
Member

bryevdv commented Apr 12, 2024

@cdeil issues are closed when fixes are merged, which does not mean the fix is published in any release yet.

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

Successfully merging a pull request may close this issue.

5 participants