Updated Bokeh and now just get blank screen

I had a working file. In adding new features I finally was able to get my workplace to update from 0.12 to 2.2.3. However, my files seem to have quit working. I get no errors in the terminal. The tab opens in the browser with the correct title but the rest of the page is blank. In the console log I have 3 errors: a syntax error that ‘missing ; before statement’ and two errors that ‘bokeh is not defined.’

This is a mre of a simple file from an example online that works with 0.12 but not 2.2.3.

import numpy as np
from bokeh.io import curdoc
from bokeh.layouts import row, column
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import Slider, TextInput
from bokeh.plotting import figure
N = 200
x = np.linspace(0, 4*np.pi, N)
y = np.sin(x)
source = ColumnDataSource(data = dict(x = x, y = y))
plot = figure(plot_height = 400, plot_width = 400, title = "sine wave")
plot.line('x', 'y', source = source, line_width = 3, line_alpha = 0.6)
freq = Slider(title = "frequency", value = 1.0, start = 0.1, end = 5.1, step = 0.1)
def update_data(attrname, old, new):
   a = 1
   b = 0
   w = 0
   k = freq.value
   x = np.linspace(0, 4*np.pi, N)
   y = a*np.sin(k*x + w) + b
   source.data = dict(x = x, y = y)
freq.on_change('value', update_data)
curdoc().add_root(row(freq, plot, width = 500))
curdoc().title = "Sliders"

Any pointers to help me solve this are greatly appreciated. Thanks!


Your example works for me running via bokeh serve with bokeh 2.2.3.

I used Google Chrome Version 87.0.4280.88 (Official Build) (x86_64) as the client browser.

Perhaps you can try clearing the cache of your web browser in case you’ve been running with both 0.12 and 2.2.3 and old info lingers?

I tried clearing the cache with no luck getting it to display. I am using Firefox version 38.6.0 which is several years old. Is there a chance that the browser may be incompatible?

I was able to confirm by sending someone else the file that my outdated browser is the issue with the updated Bokeh. Now to decide what to do until it updates my browser (which may be a long time).

FF 38 is not that old, so I am as bit surprised there is any issue. Can you try:

  • A force reload in addition to cache clear
  • Setting env var `BOKEH_MINIFIED=no"

FF 38 is not that old, so I am as bit surprised there is any issue.

As web standards go, FF 38 is ancient (2015) and will require legacy resources (BOKEH_LEGACY=true).

1 Like

Setting env var `BOKEH_MINIFIED=no"

This did not seem to change anything for me.

Not sure how to use legacy resources. Is this an environment variable as well or an argument somewhere? I am not seeing much in the documentation on it.

I have tried setting BOKEH_LEGACY=True as an environment variable as well as using the line:

No luck with either.

No luck with either.

Are there any errors/messages in JS console?

Are there any errors/messages in JS console?

Good call. I checked the console for errors before as included in the original post, but didn’t think about checking again. The most recent run was using both BOKEH_MINIFIED=False and BOKEH_LEGACY=True and there were a whole host of errors. This is the information contained in the web console.

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create bokeh.legacy.js:176:15
"[bokeh] setting log level to: 'info'" bokeh.legacy.js:8773:0
"[bokeh]" "Websocket connection 0 is now open" bokeh.legacy.js:53720:12
"[bokeh]" "Server sent key x but we don't seem to have it in our JSON" bokeh.legacy.js:4746:20
"[bokeh]" "Server sent key y but we don't seem to have it in our JSON" bokeh.legacy.js:4746:20
console.trace(): bokeh.legacy.js:53709
_/ClientConnection.prototype._repull_session_doc/ClientConnection</<() bokeh.legacy.js:53709
step() bokeh.legacy.js:311
_/__generator/verb/<() bokeh.legacy.js:260
fulfilled9) bokeh.legacy.js:234

"[bokeh]" "Failed to repull session Error: unknown property Line.undefined" bokeh.legacy.js:53710:28

"[bokeh]" "Failed to load Bokeh session mhJK42nzNjn2K5n76T6joUlmM7iYz10kVwG26KKU9E0i: Error: unknown property Line.undefined" bokeh.legacy.js:53487:24

"Error rendering Bokeh items:" Error: unkown property Line.undefined
Stack trace:

followed by a whole bunch of letters and numbers that I don’t want to retype since I am retyping all of this over from a separate computer that doesn’t have internet access.