☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Components no longer working with "inline" resources

Community Support
sdc50
sdc50

The documentation for bokeh.embed.components (bokeh.embed — Bokeh 3.3.2 Documentation) states that:

The returned components assume that BokehJS resources are already loaded .

What does this mean for the case where BOKEH_RESOURCES="inline"?

In Bokeh V2 components would work without loading BokehJS resources as long as BOKEH_RESOURCES="inline". Starting with Bokeh V3 this is no longer the case. It produces this error:

Uncaught ReferenceError: Bokeh is not defined
    at HTMLDocument.fn

Is this a bug that was introduces in Bokeh V3, or is it now just honoring what was always intended per the documentation?

⌁   Link to post
Bryan
Bryan

I think it must be this, and any other behavior in the past was accidental. I have personally never once used components outside the context of a template that loads BokehJS explicitly and separately, and that scenario was certainly the only motivating use case back when components was originally written.

⌁   Link to post
sdc50
sdc50

Thanks @Bryan. My use case is loading components into a template in Django. The BOKEH_RESOURCES could be configured to cdn, server, or inline. In the case of cdn or server then we would load the BokehJS resources separately, but with inline we didn’t have to load anything else.

⌁   Link to post
Bryan
Bryan

It appears to be missing a docstring, but Resources has a render() method that should work for any resource object (e.g. INLINE or CDN or a server one that you configure) that you could use in your template.

Just curious about the previous behavior, did all of BokehJS just get stuffed inside the script returned by components? I don’t see how it might have worked otherwise. But if so that was definitely not intentional.

⌁   Link to post

End of archived discussion · Replies are disabled