Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st.tabs cause blank page starting >1.26.0 #8676

Open
4 tasks done
rednag opened this issue May 15, 2024 · 5 comments
Open
4 tasks done

st.tabs cause blank page starting >1.26.0 #8676

rednag opened this issue May 15, 2024 · 5 comments
Labels
status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working

Comments

@rednag
Copy link

rednag commented May 15, 2024

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

After a update from 1.26.0 to 1.33.0 st.tabs causes a blank page w/o any error triggered. Seems to be the bug fixes in 1.27.0 related st.tabs introduced new bugs.

Reproducible Code Example

main.py
import streamlit as st
from src.outsourced import load_page

try:
    load_page()
except Exception as e:
    logging.error(e)

outsourced.py
import streamlit as st
from src.outsourced_tabs import load_tabs

def load_page():
    if 'status' in st.session_state:
        st.write('Current status')
    else:
        load_tabs()

outsourced_tabs.py
import streamlit as st

def load_tabs():

    tab1, tab2, tab3 = st.tabs(["123", "1234", "1235"])
    with tab1:
        st.info('Some info in tab1.')
    with tab2:
        st.info('Some info in tab2.')
    with tab3:
        st.info('Some info in tab3.')

Steps To Reproduce

  1. Page loaded
  2. Open new view by clicking on sidebar link which executes load_tabs()
  3. Page gets blanked (the page loads if in load_tabs() no tabs and st.tabs are not used)

Expected Behavior

New view with e.g. 3 tabs will be loaded.

Current Behavior

No streamlit error messages, but

in Chrome Debugger you can find the following message

Uncaught TypeError: Cannot read properties of null (reading 'label')
    at Qt (main.eccc579f.js:2:4181214)
    at wa (main.eccc579f.js:2:2254114)
    at wl (main.eccc579f.js:2:2311227)
    at zc (main.eccc579f.js:2:2300333)
    at Oc (main.eccc579f.js:2:2300261)
    at Mc (main.eccc579f.js:2:2300124)
    at cc (main.eccc579f.js:2:2297240)
    at Uo (main.eccc579f.js:2:2237835)
    at rc (main.eccc579f.js:2:2294327)
    at Object.enqueueSetState (main.eccc579f.js:2:2244853)

in FireFox Debugger you can find the following message

Uncaught TypeError: r.children[0].deltaBlock.tab is null
    Qt http://localhost:8501/static/js/main.eccc579f.js:2
    wa http://localhost:8501/static/js/main.eccc579f.js:2
    wl http://localhost:8501/static/js/main.eccc579f.js:2
    zc http://localhost:8501/static/js/main.eccc579f.js:2
    Oc http://localhost:8501/static/js/main.eccc579f.js:2
    Mc http://localhost:8501/static/js/main.eccc579f.js:2
    cc http://localhost:8501/static/js/main.eccc579f.js:2
    Uo http://localhost:8501/static/js/main.eccc579f.js:2
    rc http://localhost:8501/static/js/main.eccc579f.js:2
    enqueueSetState http://localhost:8501/static/js/main.eccc579f.js:2
    setState http://localhost:8501/static/js/main.eccc579f.js:2
    handleDeltaMsg http://localhost:8501/static/js/main.eccc579f.js:2
    setTimeout handler*Np/this.handleDeltaMsg http://localhost:8501/static/js/main.eccc579f.js:2
    delta http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    onmessage http://localhost:8501/static/js/main.eccc579f.js:2
[main.eccc579f.js:2:4181185](http://localhost:8501/static/js/main.eccc579f.js)
    Qt http://localhost:8501/static/js/main.eccc579f.js:2
    wa http://localhost:8501/static/js/main.eccc579f.js:2
    wl http://localhost:8501/static/js/main.eccc579f.js:2
    zc http://localhost:8501/static/js/main.eccc579f.js:2
    Oc http://localhost:8501/static/js/main.eccc579f.js:2
    Mc http://localhost:8501/static/js/main.eccc579f.js:2
    cc http://localhost:8501/static/js/main.eccc579f.js:2
    Uo http://localhost:8501/static/js/main.eccc579f.js:2
    rc http://localhost:8501/static/js/main.eccc579f.js:2
    enqueueSetState http://localhost:8501/static/js/main.eccc579f.js:2
    setState http://localhost:8501/static/js/main.eccc579f.js:2
    handleDeltaMsg http://localhost:8501/static/js/main.eccc579f.js:2
    (Async: setTimeout handler)
    handleDeltaMsg http://localhost:8501/static/js/main.eccc579f.js:2
    delta http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    handleMessage http://localhost:8501/static/js/main.eccc579f.js:2
    AsyncFunctionNext self-hosted:852
    (Async: async)
    onmessage http://localhost:8501/static/js/main.eccc579f.js:2

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.26.0
  • Python version: 3.10.12
  • Operating System: Ubuntu 22.04.4
  • Browser: Chromium 1.65.122 / Firefox 125.0.3

Additional Information

https://discuss.streamlit.io/t/after-update-to-1-33-0-loading-tabs-cols-sporadically-ends-up-with-blank-page/68043

Changelog from 1.27.0 -> some bug fixes in st.tabs, might be the reason for the new behavior
https://discuss.streamlit.io/t/version-1-27-0/51950

@rednag rednag added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels May 15, 2024
Copy link

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

@rednag
Copy link
Author

rednag commented May 16, 2024

Workaround - put the st.tabs in a st.columns then it works

cols = st.columns([0.999, 0.001])
with cols[0]:
    tab1, tab2, tab3 = st.tabs(['Tab1', 'Tab2', 'Tab3'])
    with tab1:
         ....

@linhnt-hub
Copy link

linhnt-hub commented May 20, 2024

I saw same issue
image

@ViniciusgCaetano
Copy link

Im have the sabe trouble. Streamlit 1.34

@kmcgrady
Copy link
Collaborator

Hey @rednag ! Thanks for the issue! I tried reproducing the issue, and I struggled. I modified two things from the example in the bug:

  1. Removed the src directory layout
  2. logging.error -> print

Is there something I am missing here?

@kmcgrady kmcgrady added status:awaiting-user-response Issue requires clarification from submitter and removed status:needs-triage Has not been triaged by the Streamlit team labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants