A while ago I started to play around with bokeh with the idea to create a data analysis web app. I implemented a couple of custom widgets in coffee script that worked in Bokeh 0.12.3. Now that I have updated Bokeh to 0.12.5 I get the following error message in the web browser:
Uncaught TypeError: Cannot read property ‘prototype’ of undefined
at extend (open_file:74)
at open_file:82
at Object.custom/file_input.file_input (open_file:134)
at i (bokeh.min.js?v=d5277ec…:1)
at l (bokeh.min.js?v=d5277ec…:1)
at Object.custom/main (open_file:64)
at Object.i [as require] (bokeh.min.js?v=d5277ec…:1)
at outer (open_file:46)
at open_file:60
Does anyone have any idea what is going on? It seems to be JavaScript code that is autogenerated that yields this error. Have I overlooked something obvious in my implementation?
I attach a zipped version of an application that displays this issue.
BokehJS used to be purely an internal implementation detail. We are working to stabilize it as best we can, but there are still currently sometimes changes that need to be made to put it on good footing for long-term maintainability. I think this section of the 0.12.4 migration notes might apply in your case:
A while ago I started to play around with bokeh with the idea to create a data analysis web app. I implemented a couple of custom widgets in coffee script that worked in Bokeh 0.12.3. Now that I have updated Bokeh to 0.12.5 I get the following error message in the web browser:
Uncaught TypeError: Cannot read property 'prototype' of undefined
at extend (open_file:74)
at open_file:82
at Object.custom/file_input.file_input (open_file:134)
at i (bokeh.min.js?v=d5277ec…:1)
at l (bokeh.min.js?v=d5277ec…:1)
at Object.custom/main (open_file:64)
at Object.i [as require] (bokeh.min.js?v=d5277ec…:1)
at outer (open_file:46)
at open_file:60
Does anyone have any idea what is going on? It seems to be JavaScript code that is autogenerated that yields this error. Have I overlooked something obvious in my implementation?
I attach a zipped version of an application that displays this issue.
Thanks a lot for putting me on the right track, I had missed that migration guide. The migration guide helped but there was one additional thing (just if anyone else is experiencing the same thing). I imported InputWidget = require "models/widgets/input_widget"
and tried to inherit the view:
class FileInputView extends InputWidget.View
Looking at the source for input_widget code that does not work anymore. Changing it to
import {InputWidget, InputWidgetView} from "models/widgets/input_widget"
....
export class FileInputView extends InputWidgetView
does now have things correctly demonstrated (i.e. "import {InputWidget, InputWidgetView}") which is probably the most important thing. However, if have any interest to submit a PR to update the historical migration guide as well, the relevant file is here:
Thanks a lot for putting me on the right track, I had missed that migration guide. The migration guide helped but there was one additional thing (just if anyone else is experiencing the same thing). I imported InputWidget = require "models/widgets/input_widget"
and tried to inherit the view:
class FileInputView extends InputWidget.View
Looking at the source for input_widget code that does not work anymore. Changing it to
import {InputWidget, InputWidgetView} from "models/widgets/input_widget"
....
export class FileInputView extends InputWidgetView