Bokeh serve on remote server can't find javascript files

I have two Bokeh apps deployed via Digital Ocean App. On one instance, it seems like it deployed fine and I can see the app. The second one however, doesn’t display anything and it seems like the error might be that Bokeh Javascripts are pointed to some local host location.

How the static file links look like on the version that’s not working (Bokeh 3.2.0)

I’m wondering what I need to set this? Sort of strange because this worked before and seems to have changed after I updated the Bokeh version to 3.2. The one that’s working is running a very old version of Bokeh, version 2.4.1, points to files correctly, without the `http://localhost’ part.

This was deployed using Procfile, bokeh serve explorer --port=$PORT --num-procs=2, along with ‘allow_websocket_origin’ and ‘–use-xheaders’ options.

Anyhelp here would be greatly appreciated. When I deploy the problem app locally, it also seems to point to ‘http://localhost’ location but running things locally of course isn’t a problem but don’t know how to set this differently for remote deploy.

Thanks!

Ok nevemind - got the answer here. Just in case other people might run into the issue…

Not sure if the default behaviour changed somehow but was able to set it via the following line in the main Python script for the Bokeh app.

from bokeh.settings import settings
settings.resources = 'cdn'

Cheers,

It was a regression bug

It will be fixed in version 3.3. That said, I would recommend using CDN resources as the best practice for “production” deployments regardless. We may even change the server to use CDN by default, but it’s not a completely clear-cut decision to do so.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.