You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
1.5.1: intermittent ReferenceError: kaleido_scopes is not defined, because navigate() can return before the page has loaded #487
Since upgrading to 1.5.1, plotly.io.write_image sometimes fails with:
kaleido._kaleido_tab._errors.JavascriptError: {'result': {'type': 'object', 'subtype': 'error',
'className': 'ReferenceError', 'description': 'ReferenceError: kaleido_scopes is not defined\n
at <anonymous>:1:26', ...}}
It's intermittent and depends on load. It shows up reliably when several exports run in parallel, as in a Sphinx-Gallery docs build with -j. 1.5.0 is not affected.
Issue seen localy, as well as on CircleCI builds:
Docker image cimg/python:3.14-browsers, medium resource class
Chrome installed with kaleido_get_chrome
Exports run during a Sphinx-Gallery build with sphinx -j 2
It covers a single export that failed: the first export in a fresh process, so it starts from browser launch.
Produced with kaleido 1.5.1, choreographer 1.4.0, plotly 6.8.0, Python 3.14.0, and Chrome for Testing 142.0.7444.175 (from kaleido_get_chrome) on Linux. Four of these processes ran in parallel to create load:
# repro_logs.pyimportlogistrologistro.betterConfig() # applies --logistro-level from the command lineimportosimportplotly.graph_objectsasgoimportplotly.ioaspiorun=os.environ["RUN"]
foriinrange(15):
fig=go.Figure(go.Scatter(x=[1, 2], y=[3, i]))
try:
pio.write_image(fig, f"out_{run}_{i}.png")
exceptExceptionase:
print(f"FAIL on export {i}: {type(e).__name__}: {str(e)[:100]}", flush=True)
break
This may have been caused by my PR #482. If so, apologies for the disruption! I was trying to fix a different race condition and may have caused another 🤦
Perhaps. That's up to the maintainers. Seems that the new race condition
introduced by the fix is slightly more common than the race condition I was
fixing.
Activity
ayjayt commentedon Nov 13, 2026
Not the first time I've seen the error, so I know which system its probably in, I still can't do anything without logs.
If you set the logging level to 1, you're going to get pages and pages and pages of logs.
Please upload them as a file.
sdhiscocks commentedon Nov 13, 2026
Thanks. Log at level 1 attached: kaleido-1.5.1-issue487-level1.log
It covers a single export that failed: the first export in a fresh process, so it starts from browser launch.
Produced with kaleido 1.5.1, choreographer 1.4.0, plotly 6.8.0, Python 3.14.0, and Chrome for Testing 142.0.7444.175 (from kaleido_get_chrome) on Linux. Four of these processes ran in parallel to create load:
All four failed in that run; this is the shortest log. Some line numbers to help navigate:
1015: Page.enable
1243: Page.navigate
1284: Page.loadEventFired
1352: Runtime.enable
1429: Runtime.executionContextCreated
1535: ReferenceError
With 1.5.0, the same script doesn't fail.
Drafted with help from Claude
dennisjlee commentedon Nov 13, 2026
This may have been caused by my PR #482. If so, apologies for the disruption! I was trying to fix a different race condition and may have caused another 🤦
dennisjlee commentedon Nov 13, 2026
I'm looking into how I can refine my previous fix to also defend against this case.
This sequence of events is currently possible:
Dev-iL commentedon Nov 15, 2026
@dennisjlee would it make sense to yank 1.5.1 from pypi?
dennisjlee commentedon Nov 15, 2026
Exclude kaleido 1.5.1 (plotly/kaleido#487)
dennisjlee commentedon Nov 17, 2026
@camdecoster sorry for the trouble. Do you have time to review #488? I'm comfortable yanking 1.5.1 from Pypi in the meantime as well.
camdecoster commentedon Nov 17, 2026
I'm looking at #488 right now. I don't think we need to yank since this issue doesn't manifest for everyone.