streamlit.errors.StreamlitAPIException: [... ]is a not a valid URL!

Hello,
I’m trying to add an email address in the page configuration.

st.set_page_config(page_title="my title",
                       page_icon=img,
                       initial_sidebar_state="collapsed",
                       menu_items={
                           "Get Help": "https://mypage.com",
                           "Report a bug": "support@fake_email.gmaill"})

Note: above are fake email / website.

My problem is that the web address’s link works fine but got an error for the email address : streamlit.errors.StreamlitAPIException: "" is a not a valid URL!

I saw that this feature was added last year

Do I need to add html tag or some css codes ?

Thanks for any help,
Jonathan

Debug info

  • Streamlit version: 1.26.0
  • Python version: 3.11.4
  • Using a virtual environment within PyCharm (base is 3.11.4)
  • OS version: mac os catalina
  • Browser version: tested with safari, chrome and Firefox

Hey @jonathanbouchet,

Whenever you want to point to a link, the string value should start with mailto:

Which means if the e-mail is foo@gmail.com, you want to use mailto:foo@gmail.com instead :slight_smile:

Hope that helps, if yes, I agree the error could be a bit more explicit!

Btw, that’s in the docs

1 Like

Thanks @arnaud

I noticed my mistake after reading your email.

For some reason I was expecting to see the links in the About section of the drop-down menu, whereas the help and report a bug are their own sections.

And yes the mailto: works perfectly.

Thanks for the help.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.