blackary / st_pages

An experimental version of Streamlit Multi-Page Apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"The page that you have requested does not seem to exist. Running the app's main page."

alon-sht opened this issue · comments

commented

"Page not found. The page that you have requested does not seem to exist. Running the app's main page."
I constantly get this error on start up
Is there a way to avoid it?

What version of st_pages are you using?

commented

I was using 0.3.0 but just updated to 0.3.5 and I still get this error.

I'm also get the same error(using 0.3.5)
I want to list pages in sidebar using st_pages
and move to other pages with button in main page (with streamlit_extras).

But when I click the button first after running the app, this error occurs.
Although the error message pops up, the page navigated correctly.🤔

Thanks, that's very helpful. Would any of you have a repository you could share that shows this behavior, so I can reproduce the exact situation?

Oh, thank you for your quick reply.
I made an example code which shows the same error and put it in here!

I have encountered the same issue where I received a "Page not found" error message upon my first visit to the webpage. However, this error did not affect the normal display of the page. Instead, the app's main page was loaded.

@geesuee Thanks for the repo! I'll look into that particular interaction with the page switch button and this repo. It's probably related to this issue, but I'm not sure yet -- it might be more of an issue on the extras side.

Does anybody (@duanyongyao, @alon-sht) have another example repo where this Page Not Found happens consistently?

commented

I am also using switch_page function by streamlit_extras
But I couldn't pin point it to this as the source of this error.
Although @geesuee 's simple example, does seem to point to it as the source of the problem.

I'm not sure if the issue is caused by my use of streamlit_chat and streamlit_authenticator.

According to my setup, this is caused by the streamlit_authenticator, when used in conjuction with the st_pages

I'm not using streamlit_authenticator and I still get this annoying error...

Same issue here. Not using streamlit_authenticator.

For me the problem was using st_extras.

It feels like the sub page is not registered with streamlit, so when the user first starts the app with the sub page, streamlit cannot find that URL. After the home page is run, then the sub page is registered, and that error doesn't show up anymore.

I'd like to add my own example into consideration. Specifically, I am receiving this error alongside the package streamlit_javascript. Its a pretty clean example of error when I use st_javascript, and no error when I don't. My versions are:
Streamlit: 1.28.1
St_pages: 0.4.5
streamlit_javascript: 0.1.5
streamlit_extras 0.3.5

I have also included a minimal working example below (titled: testingpages.py). This example produces the error in the Issues Title, but if you were to comment lines 10-12, the error goes away. Any help would be greatly appreciated! Thank you for your thoughts

import streamlit as st
from streamlit_javascript import st_javascript
from streamlit_extras.add_vertical_space import add_vertical_space 
from st_pages import add_indentation, Page, Section, show_pages

def main():
    st.write('Some Text')
    add_vertical_space(2)

    with st.sidebar:
        url = st_javascript("await fetch('').then(r => window.parent.location.href)")
        st.write(f'''[Open app in new Tab]({url})\n (MS Edge/ Google Chrome)''')

    add_indentation()
    show_pages(
    [
        Page("testingpages.py", "Welcome", "🏠"),
    ])

if __name__ == '__main__':
    main()