It's a good suggestion that this could be a race condition. However, it's then odd that every other execution works. Here is the structure we're using. In the Python portion of the vpython module were these statement (before breaking the glow library into two pieces):
package_dir = os.path.dirname(__file__)
notebook.nbextensions.install_nbextension(path = package_dir+"/data/jquery-ui.custom.min.js",overwrite = True,user = True,verbose = 0)
notebook.nbextensions.install_nbextension(path = package_dir+"/data/glow2.1.min.js",overwrite = True,user = True,verbose = 0)
notebook.nbextensions.install_nbextension(path = package_dir+"/data/glowcomm.js",overwrite = True,user = True,verbose = 0)
And here was the start of the glowcomm.js file:
define(["nbextensions/jquery-ui.custom.min","nbextensions/glow.2.1.min"], function() {
/*jslint plusplus: true */
I inherited these statements from a colleague far more knowledgeable about Jupyter than me, but I would assume that these statements are intended to ensure that all libraries are loaded before execution starts, no? I repeat that breaking glow2.1.min.js into two pieces completely eliminated the problem, whereas one might expect that adding another library would enhance a race condition.