Skip to content

Dashboard fails to load on a fresh pip install (breaks with newer Bokeh version) #37

Description

@Ttheegela

Describe the bug
When someone installs the package fresh with pip, on a computer that doesn't already have an older version of Bokeh installed, the generated dashboard HTML file fails to open properly in a browser. The page shows JavaScript errors and none of the charts, tables, or plots appear. This only shows up on a truly fresh install, which is why our existing pip test guide (tests/pip_install_testing.md, test T-07) missed it: the machine we tested on already had an older, compatible version of Bokeh installed from other work.

Root cause
Our code inserts the sea-level data into the dashboard's HTML file by searching the file for a specific marker and inserting the data right before it. That marker was assumed to appear only once in the file. The newer version of Bokeh that a fresh pip install picks up (3.9.1) happens to bundle some additional code that, by coincidence, contains text that looks like that same marker earlier in the file, before the real one. Our code grabbed this fake, earlier marker instead of the real one and inserted our data in the wrong spot, which corrupted the file and broke the page.

Fix
Changed the code to look for the last matching marker in the file instead of the first one. The last one is always the real one, since nothing legitimate comes after it. Tested this fix by generating dashboards under both the older and newer Bokeh versions, and confirmed the dashboard now loads and displays correctly either way.

Fixed in
Already applied on the working branch (chore/remove-irrelevant-files), not yet committed/merged into main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions