question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Incorrect initialization when loading out of focus

See original GitHub issue

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh.version = 1.2.0 python: 3.6.8 OS: Windows 10 browser: all

Description of expected behavior and the observed behavior

When loading a bokeh document (served using the directory format) the jinja2 template is not filled as expected if page is not in focus within 30 seconds of loading. Root elements are added successfully in the positions indicated in the template, but figures and ui elements are appended to the bottom of the body instead of in their bk-root elements.

Complete, minimal, self-contained example code that reproduces the issue

The code below places a single checkbox inside a jinja2 template. The console will print a counter going up to 25.000 as a simulated loading process and to give you an opportunity to click away to a different tab or minimize the window. When the counter stops running in your console wait another 30 seconds or more. After the waiting period you can click on the loaded tab and the bokeh document will reload (the counter runs again in your console). After it completes the checkbox will appear. Inspecting the element will show an empty bk-root inside the intended-div, and the checkbox appended to the bottom of the html body instead.

main.py

from bokeh.plotting import curdoc
from bokeh.models import CheckboxGroup

CHECKBOX = CheckboxGroup(labels=['test checkbox'],
                         name="test")

for x in range(25000):
        print("delaying add_root by " + str(x))

curdoc().add_root(CHECKBOX)

templates/index.html

{% from macros import embed %}
{% extends base %}
<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="utf-8">
      <title>Test</title>
        <link
            href="https://cdn.pydata.org/bokeh/release/bokeh-1.2.0.min.css"
            rel="stylesheet" type="text/css">
        <link
            href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.2.0.min.css"
            rel="stylesheet" type="text/css">
        <link
            href="https://cdn.pydata.org/bokeh/release/bokeh-tables-1.2.0.min.css"
            rel="stylesheet" type="text/css">
        
        <script src="https://cdn.pydata.org/bokeh/release/bokeh-1.2.0.min.js"></script>
        <script src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.2.0.min.js"></script>
        <script src="https://cdn.pydata.org/bokeh/release/bokeh-tables-1.2.0.min.js"></script>
        <script type="text/javascript"> Bokeh.set_log_level("debug"); </script>
  </head>
  <body>
        {% block contents %}
            <div id="intended-div">
                {{ embed(roots.test) }}
            </div>
            <div>Checkbox should be above this element</div>
        {% endblock %}     
  </body>
</html>

Stack traceback and/or browser JavaScript console output

No errors thrown

Screenshots or screencasts of the bug in action

Empty intended div, checkbox appended to bottom of body image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
philippjfrcommented, Dec 20, 2019

At this point the next release will be bokeh 2.0 and we’ve already worked out a potential solution to fix the issue by that time so we likely won’t be adding the warning.

0reactions
MarcSkovMadsencommented, Dec 22, 2019

You are all working so fast @philippjfr . Take care.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dead by Daylight Initialization Error Explained & Possible Fixes
This problem is caused by either corrupted cache files on consoles, corrupted Steam game files on PC, or server issues in general.
Read more >
"Error initializing VBA components" when running a macro in ...
This article describes how to resolve "Error initializing VBA components" when running a macro in Reflection Desktop.
Read more >
Vive Pro Eye Calibration Initialization Error Troubleshooting
Vive Pro Eye Calibration Initialization Error Troubleshooting. Problem: Launching calibration shows error: "Initialization Failed".
Read more >
React.js - input losing focus when rerendering - Stack Overflow
I am just writing to text input and in onChange event I call setState , so React re-renders my UI. The problem is...
Read more >
Error loading lvanlys.dll. Initialization routine failed.
My pc has no problem with multiprocessor stuff (Like here and here) and I really run out of ideas and would appricieate any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found