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] Uncaught (in promise) TypeError: Cannot read property 'connect' of undefined #10345
Comments
callback = CustomJS(code='console.log("Callback!", cb_obj)')
dropdown.js_on_event('menu_item_click', callback) where |
I will consider this to be a bug, because a simple usage mistake should not result in a JS exception. |
Thanks for the fast response! Where can I find (or work) out which widgets support which events? (I searched the docs for |
If you have that defined somewhere, I could possibly add sanity checking to |
@mattpap I have now run in to this exact question on Discourse, SO, and other places at least a dozen times. I have to say I think changing this in this way was a mistake, and I wish that I had better noticed the original work so that it could have been more thoroughly discussed. Other frameworks (e.g. Dash) certainly treat the combo box callback as a function that receives the bare value that can then be used immediately. It's certainly far simpler for users, and a reasonable expectation that the API be centered around the value since that is the thing that is actually of interest. I would in fact, suggest adding a value property back that gets set whenever the event is emitted. @Singletoned Thank you for the offer, unfortunately the information is defined in BokehJS, on the JavaScript side. It would certainly good to have a Python side specification for things that emit events, but that would be a bit of a project (e.g. there would need tests to make sure JS/Python are always in agreement, and a main point of that information would be to automate docs generation, so some docs work as well). That said, certainly happy to advise further if there's still interest. |
We have |
This appears to be related to #9218
When I add a dropdown with a callback to a Bokeh chart, then in the browser it causes a Javascript error.
I'm very new to Bokeh, so it is quite possible that I am doing something wrong, though I suspect that this isn't the intended behaviour anyway. I'd be glad to hear of any workarounds I can do.
I'm trying to add a dropdown that allows users to choose which groups of data will be shown in the chart (roughly similar to the way you can click on the legend to show hide things).
ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)
bokeh==2.1.1
Ubuntu and OSX
Python 3.8
Latest Chrome and Chrome Canary, latest Firefox (slightly different error in Firefox
Uncaught (in promise) TypeError: n is undefined
)Description of expected behavior and the observed behavior
I expect to see the chart on the page. I don't see the chart on the page.
If I add a callback to the dropdown, it breaks. If I don't add the callback, it works.
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
From Chrome
From Firefox
The text was updated successfully, but these errors were encountered: