My application is launched from Python. The user is presented with a browser interface which they can interact with, update the display with images fetched from Python, and finally, return results to Python and continue with Python scripting.
With Bokeh 2.4.3, I had custom models which I precompiled into a minified JS file using bokeh build. I then loaded this minified file after the Bokeh <script> lines in the HTML file <head> section. An example of one of these is found here. With Bokeh 3.1.1, it seems as though the JavaScript implementation details are expected in a namespace modeled on the Python package hierarchy because with 3.1.1 I get an error in the console:
Uncaught (in promise) Error: could not resolve type 'casagui.bokeh.sources._image_data_source.ImageDataSource', which could be due to a widget or a custom model not being registered before first usage
at p.error (bokeh-3.1.1.min.js:211:4951)
at p._resolve_type (bokeh-3.1.1.min.js:211:5059)
at p._decode_object_ref (bokeh-3.1.1.min.js:211:4782)
at p._decode (bokeh-3.1.1.min.js:211:1779)
at bokeh-3.1.1.min.js:211:2711
at f (bokeh-3.1.1.min.js:178:450)
at p._decode_map (bokeh-3.1.1.min.js:211:2640)
at p._decode (bokeh-3.1.1.min.js:211:1379)
at p._decode_plain_object (bokeh-3.1.1.min.js:211:2340)
at p._decode (bokeh-3.1.1.min.js:211:1066)
I export these custom models in the index.ts for the bokeh build. How can I force bokeh build to export the implementation for the custom models in a way that is compatible with the namespace expected when the generated HTML file is loaded into a browser.
I assume this is something I’ve done wrong in my initial approach, but everything I’ve tried has not worked. I need to update to Bokeh to get access to newer features.
Thanks very much for any advice…

