streamlit / streamlit

Streamlit — A faster way to build and share data apps.

Home Page:https://streamlit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InvalidStateError: CanvasRenderingContext2D.scale: Canvas is already in error state.

abokey1 opened this issue · comments

commented

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

I'm getting the error in Firefox but not in Chrome.

Here's how it appears with a streamlit run .\app.py --server.port 8080 :

image

And here is the Traceback (as text):

InvalidStateError: CanvasRenderingContext2D.scale: Canvas is already in error state.

78170/pe</Et<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:189843
78170/pe</<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:190125
ol@http://localhost:8080/static/js/main.33cac65c.js:10:2346148
yl@http://localhost:8080/static/js/main.33cac65c.js:10:2353444
zl@http://localhost:8080/static/js/main.33cac65c.js:10:2353288
gl@http://localhost:8080/static/js/main.33cac65c.js:10:2352824
73207/Ac/<@http://localhost:8080/static/js/main.33cac65c.js:10:2364661
Ac@http://localhost:8080/static/js/main.33cac65c.js:10:2365176
cc@http://localhost:8080/static/js/main.33cac65c.js:10:2358895
Uo@http://localhost:8080/static/js/main.33cac65c.js:10:2299288
rc@http://localhost:8080/static/js/main.33cac65c.js:10:2355780
ns@http://localhost:8080/static/js/main.33cac65c.js:10:2320925
78170/lt</po<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:264155
78170/xe/L<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:213609
78170/xe/F<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:213802
78170/ye/P<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:210332
78170/ye/<@http://localhost:8080/static/js/9589.fa50c837.chunk.js:2:211357

Reproducible Code Example

Not a MRE but at least the configuration that triggers the error on my machine.

import streamlit as st

@st.cache_data
def _get_df():
    # df is made from an sql query
    # len(df.columns) is 94
    return df

tab_1, tab_2, tab_3 = st.tabs(3)
with tab_1:
    st.dataframe(_get_df(), hide_index=True, use_container_width=True)
    # + a pagination using `st.input_number` and `st.selectbox`
    # + an `st.toggle` (that uses a fragment of `st.download_button`) to export the dataframe

# rest of the code

Debug info

  • Streamlit version: 1.38.0
  • Python version: 3.10.13
  • Operating System: Windows 10
  • Browser: Firefox 132.0.1

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@abokey1 Thanks for reporting this issue. Unfortunately, I wasn't able to reproduce this issue with Firefox 132.0.1. And as far as I know, this is the first time this error has been reported.

Does the error directly appear when opening the app? Does the error appear always?

Can you check if it also runs into the error with Streamlit 1.39? We fixed a similar issue in 1.39 with dataframe here.

commented

@abokey1 Thanks for reporting this issue. Unfortunately, I wasn't able to reproduce this issue with Firefox 132.0.1. And as far as I know, this is the first time this error has been reported.

@lukasmasuch, you're welcome.

Does the error directly appear when opening the app? Does the error appear always?

The error appears always in Firefox and 1.38.0.

Can you check if it also runs into the error with Streamlit 1.39? We fixed a similar issue in 1.39 with dataframe here.

Upgrading to 1.39.0 fixed the issue for me, thank you ;)

Facing the same issue while on Streamlit v1.40.0 and Firefox. Downgrading to V1.39 solved the issue. Should I start a different thread for it?

@SPRAGE is it the exact same error? And do you have a minimal snippet that allows reproducing it?

@lukasmasuch Yes, it was the same error. I tried to reproduce it today again after updating to v1.40.1 and it works just fine.

I will post the code if this turns up again. Thank you.

@lukasmasuch Downgraded to v 1.40.0 and the error pops up again. Below is the screenshot

image

The code used is as follows

import pandas as pd
import streamlit as st

df = pd.read_csv('instruments.csv')
st.dataframe(df)

The instruments.csv is
instruments.csv

Firefox: 131.0.2(64-bit)
Streamlit: 1.40.0