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

[Bug]: StreamlitDuplicateElementId Error when Plotting with Plotly #382

Closed
5 tasks done
A-Akhil opened this issue Oct 9, 2024 · 4 comments
Closed
5 tasks done

[Bug]: StreamlitDuplicateElementId Error when Plotting with Plotly #382

A-Akhil opened this issue Oct 9, 2024 · 4 comments

Comments

@A-Akhil
Copy link
Contributor

A-Akhil commented Oct 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When rendering a Plotly chart using st.plotly_chart(fig), the app encounters the following error:
StreamlitDuplicateElementId: This app has encountered an error...

Screenshot from the website

Add ScreenShots

Traceback:

File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "/mount/src/stackoverflow-analysis/streamlit/home.py", line 139, in
main.main_analysis_2(df2018)
File "/mount/src/stackoverflow-analysis/streamlit/main_analysis.py", line 265, in main_analysis_2
ff.plot_bar_plotly(ds, "Country")
File "/mount/src/stackoverflow-analysis/streamlit/functions.py", line 49, in plot_bar_plotly
return st.plotly_chart(fig)
^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/metrics_util.py", line 410, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/elements/plotly_chart.py", line 506, in plotly_chart
plotly_chart_proto.id = compute_and_register_element_id(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/elements/lib/utils.py", line 226, in compute_and_register_element_id
_register_element_id(ctx, element_type, element_id)
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/elements/lib/utils.py", line 132, in _register_element_id
raise StreamlitDuplicateElementId(element_type)

What browsers are you seeing the problem on?

Firefox, Chrome

Record

  • I agree to follow this project's Code of Conduct
  • I'm a GSSOC contributor
  • I want to work on this issue
  • I'm willing to provide further clarification or assistance if needed.
Copy link

github-actions bot commented Oct 9, 2024

Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊

You can also check our CONTRIBUTING.md for guidelines on contributing to this project.

Copy link

github-actions bot commented Oct 9, 2024

Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible.

@A-Akhil
Copy link
Contributor Author

A-Akhil commented Oct 9, 2024

I would like to work on this issue, kindly please assign it to me.
Please add the necessary labels, including the appropriate level @sanjay-kv

A-Akhil added a commit to A-Akhil/Stackoverflow-Analysis that referenced this issue Oct 15, 2024
A-Akhil added a commit to A-Akhil/Stackoverflow-Analysis that referenced this issue Oct 15, 2024
sanjay-kv added a commit that referenced this issue Oct 16, 2024
Issue #382 fixed StreamlitDuplicateElementId
@A-Akhil A-Akhil closed this as completed Oct 18, 2024
Copy link

Hello @A-Akhil! Your issue #382 has been closed. Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants