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

Streamlit App showing up blank in Safari #8362

Closed
3 of 4 tasks
Odrec opened this issue Mar 22, 2024 · 30 comments · Fixed by #8434
Closed
3 of 4 tasks

Streamlit App showing up blank in Safari #8362

Odrec opened this issue Mar 22, 2024 · 30 comments · Fixed by #8434
Labels
priority:P3 status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working

Comments

@Odrec
Copy link

Odrec commented Mar 22, 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

This app shows up blank in Safari but works in other browsers: ki.uos.de
Here is the code

The Safari versions we have tested: 16.5.1, 17.2.1

with the latest version of streamlit

There was a similar issue previously but it's closed so I opened this new since it appears it's a persistent problem with some users. We tested some other apps in the same browsers and they worked so it's not for every Streamlit app apparently.

Reproducible Code Example

No response

Steps To Reproduce

No response

Expected Behavior

No response

Current Behavior

No response

Is this a regression?

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

Debug info

  • Streamlit version: latest
  • Python version: 3.12
  • Operating System: Linux
  • Browser: Safari

Additional Information

No response

@Odrec Odrec added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Mar 22, 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

@willhuang1997
Copy link
Collaborator

Hi @Odrec , I couldn't quite reproduce this with Safari 17.3.1. Looking at the linked issue, is this on mobile IOS or safari desktop too?

@willhuang1997 willhuang1997 added the status:awaiting-user-response Issue requires clarification from submitter label Mar 25, 2024
@Odrec
Copy link
Author

Odrec commented Mar 25, 2024

Hi @Odrec , I couldn't quite reproduce this with Safari 17.3.1. Looking at the linked issue, is this on mobile IOS or safari desktop too?

Hello, thanks for the answer. Personally, I have only tried it on Desktop (Safari 16.6). But already 4 people with different Safari versions tried it and had the same issue where only the radio buttons for the language selection show up, I think one of them tried it on cellphone too. I'm currently installing the latest Safari version on the Mac I have here to try it.

The only error I see on the console says: "Error while parsing the 'sandbox' attribute: 'allow-downloads' is an invalid sandbox flag."

@Odrec
Copy link
Author

Odrec commented Mar 25, 2024

Hi @Odrec , I couldn't quite reproduce this with Safari 17.3.1. Looking at the linked issue, is this on mobile IOS or safari desktop too?

Now I'm really puzzled, I tried with the latest Safari Desktop (17.4.1) and it's still the same result, only the language radio buttons appear. Only you have reported that it isn't happening with Safari. Can someone else try to access it with Safari and report?

@willhuang1997
Copy link
Collaborator

willhuang1997 commented Mar 25, 2024

Hm actually, I retried and I am only seeing the radio buttons. What streamlit version is this using? Is this 1.32.2?

@willhuang1997 willhuang1997 added priority:P1 and removed status:awaiting-user-response Issue requires clarification from submitter labels Mar 25, 2024
@willhuang1997
Copy link
Collaborator

It seems like you're embedding an app right? How does this streamlit app work?

@Odrec
Copy link
Author

Odrec commented Mar 26, 2024

It seems like you're embedding an app right? How does this streamlit app work?

We are using the latest version from streamlit yes. The app is a chatbot app done completely in streamlit using some community components. The entry point is the start.py script which is the one that should load when you click on the link but that shows up mostly blank only in Safari. This is only the Welcoming page where the user enters the university credentials to access the chat app. In this script we initialize language because we use the gettext library for multilanguage support, then we use a cookie manager component for streamlit to manage very basic access cookies. We also have a component to manage the LDAP authentication with the University credentials and that's basically it.

Thanks for the help!

@Odrec
Copy link
Author

Odrec commented Mar 26, 2024

I suspect the problem is related to the cookies manager. Although I tried making the Safari settings for cookies as loose as possible (I deactivated all tracking restrictions) and it still didn't fix the issue but maybe there's something fundamentally different on how Safari is managing cookies?

@willhuang1997
Copy link
Collaborator

It seems like regular streamlit with safari works. Should a bug should be filed with the cookies manager widget repo?

@Odrec
Copy link
Author

Odrec commented Mar 27, 2024

I'll report back if I'm sure it's the cookies thing. Problem is that the package has been 3 years with no dev but it's the most functional cookies package I've found for streamlit.

@drankush
Copy link

same here.
App giving blank screen in: Mac -Safari / iphone - Chrome/Safari
App opening in: Mac -Chrome / Android - Chrome
(all latest versions)

@kajarenc
Copy link
Collaborator

@Odrec , @willhuang1997 could be relevant to this: #8387

@willhuang1997
Copy link
Collaborator

@Odrec , I think this might be fixed by this PR:
#8389

We noticed that a few custom components were breaking.

@Odrec
Copy link
Author

Odrec commented Mar 29, 2024

Oh ok, this could actually be it. While trying to figure this out, we noticed there was something going on that seemed related to the components API and there was some weird race condition with the cookies component that is causing this issue for us in Safari but we gave up because we couldn't pinpoint what it was. I'll try it next week and report back. Thanks!

@kmcgrady
Copy link
Collaborator

kmcgrady commented Apr 1, 2024

Hey @Odrec ! We've spent some more time looking this. You seem on the right track with the cookies race condition, but we do not see any special logs in Safari indicating a problem. Let us know if you get more information and perhaps a small repro example.

@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 Apr 1, 2024
@Odrec
Copy link
Author

Odrec commented Apr 3, 2024

Hey @Odrec ! We've spent some more time looking this. You seem on the right track with the cookies race condition, but we do not see any special logs in Safari indicating a problem. Let us know if you get more information and perhaps a small repro example.

Hello @kmcgrady, thanks for the help! Here is a minimal reproducible example:

import streamlit as st
from streamlit_cookies_manager import EncryptedCookieManager

st.write("Test 1")

cookies = EncryptedCookieManager(
    prefix="whatever",
    password="123"
)

st.write("Test 2")

if not cookies.ready():
    # Wait for the component to load and send us current cookies.
    st.spinner()
    st.stop()

st.write("Test 3")

It's currently running here

If you want to test it yourself, install the patched version of the cookies manager to avoid the warning message:

pip install streamlit-cookies-manager-hotpatched

@kmcgrady
Copy link
Collaborator

kmcgrady commented Apr 4, 2024

Hey @Odrec I think I found the problem and created a PR. I've included a zip of a wheel file if you could test to verify this works for you. It seems to work in my tests. It seems like the race condition is tied to not knowing the component is ready by the time we receive the value. We end up dropping the message.

streamlit-1.32.2-py2.py3-none-any.whl.zip

GitHub does not support Wheel extension so this is a zip file of a wheel. You'll need to unzip then install manually.

kmcgrady added a commit that referenced this issue Apr 5, 2024
## Describe your changes
From our issue, it seems that there's a race condition between our
component being ready and our component sending us values. I believe
this is a result of the fact that the event handler is not receiving the
latest "ready state" by the time it receives the value. This change
makes the ready state dynamic.

## GitHub Issue Link (if applicable)
Closes #8362

## Testing Plan

I think this would be difficult to test outside of manual testing. We
could perhaps construct some large-scale unit test that simulates the
race condition reliably, but I imagine the effort is not worth the
benefit here (especially since this seems to impact Safari). We can
supply a wheel file to developers to try out and confirm.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
@kmcgrady
Copy link
Collaborator

kmcgrady commented Apr 5, 2024

Merged the change cause from our side it works. It will be in streamlit-nightly tomorrow. Let us know if you see any issues with the wheel file.

@Odrec
Copy link
Author

Odrec commented Apr 8, 2024

Merged the change cause from our side it works. It will be in streamlit-nightly tomorrow. Let us know if you see any issues with the wheel file.

Unfortunately, it doesn't seem to work. We tried it with streamlit-nightly and it didn't work for us. Same result where the whole page doesn't load.

@kmcgrady
Copy link
Collaborator

kmcgrady commented Apr 8, 2024

@Odrec , did this not work with the wheel file in my previous comment? We spent time trying to reproduce with the fix and didn't notice any bad behavior.

@Odrec
Copy link
Author

Odrec commented Apr 10, 2024

@Odrec , did this not work with the wheel file in my previous comment? We spent time trying to reproduce with the fix and didn't notice any bad behavior.

Ok, it didn't work with the nightly version but we finally tested with the wheel in the deployed version and it works! Thanks a lot!

@kmcgrady
Copy link
Collaborator

Awesome! Glad to hear! This will be in the next release! 😊

@drankush
Copy link

Using that provided whl also, im still not able to access my website either on iphone - chrome/safari or Mac - Safari

in my website im using the (Option 2)
https://docs.streamlit.io/knowledge-base/deploy/authentication-without-sso

i also cannot access on Safari or on iPhone (using any browser), https://ki.uos.de

@Odrec
Copy link
Author

Odrec commented Apr 12, 2024

Using that provided whl also, im still not able to access my website either on iphone - chrome/safari or Mac - Safari

in my website im using the (Option 2) https://docs.streamlit.io/knowledge-base/deploy/authentication-without-sso

i also cannot access on Safari or on iPhone (using any browser), https://ki.uos.de

We are not using the wheel on our release version of the app so it won't work yet. We are waiting for the next release version of streamlit to include the changes. Our issue was with Safari but all other browsers worked fine

@drankush
Copy link

but I hosted my app using that wheel provided in comment on github, still it is not loading in Safari and in Iphone on any browser.

@Odrec
Copy link
Author

Odrec commented Apr 12, 2024

but I hosted my app using that wheel provided in comment on github, still it is not loading in Safari and in Iphone on any browser.

Maybe it's a different issue then because it solved ours.

@feraldolim
Copy link

but I hosted my app using that wheel provided in comment on github, still it is not loading in Safari and in Iphone on any browser.

Maybe it's a different issue then because it solved ours.

hi, I'm still experiencing this same issue on Streamlit 1.33.0, using the package streamlit-cookies-manager-hotpatched too for the cookies management. nothing shows up on Safari (mac) and all iOS browsers.

is the fix only implemented on that wheel?

@Odrec
Copy link
Author

Odrec commented Apr 24, 2024

but I hosted my app using that wheel provided in comment on github, still it is not loading in Safari and in Iphone on any browser.

Maybe it's a different issue then because it solved ours.

hi, I'm still experiencing this same issue on Streamlit 1.33.0, using the package streamlit-cookies-manager-hotpatched too for the cookies management. nothing shows up on Safari (mac) and all iOS browsers.

is the fix only implemented on that wheel?

Not yet, the fix will be in the next release version of streamlit. If you use the wheel it should work

@feraldolim
Copy link

Not yet, the fix will be in the next release version of streamlit. If you use the wheel it should work

ok, thanks! right now I will use Streamlit 1.31.0 as I tried just now and it doesn't have the bug on Safari Mac and iOS browsers. the pages displayed without any issue with the cookies manager (though it seems cookies are not saved correctly in the browser, but this might be another different issue).

will wait for the next release!

@woojuini
Copy link

woojuini commented Apr 29, 2024

Since the downgrade Streamlit 1.31.0, the issue has been resolved in version safari 15, but the issue persists in version 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:P3 status:awaiting-user-response Issue requires clarification from submitter type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants