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

MarshallComponentsException Fix #280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danialcheung
Copy link

@danialcheung danialcheung commented Jun 14, 2024

Fixes AttributeError: module 'streamlit.components.v1' has no attribute 'components' by changing components.components.MarshallComponentException to components.custom_component.MarshallComponentException as found in the corresponding module for the Streamlit Repo.

Fixes #275

Fixed "module 'streamlit.components.v1' has no attribute 'components'" by changing "components" to "custom_components".
@JamesLeslieAT
Copy link

Please can this PR be approved?
This issue is preventing us from using recent versions of Streamlit.

@mistlet0e
Copy link

Yes please, this would be really helpful for my project

@Ricardonacif
Copy link

Pretty please :D

@Ricardonacif
Copy link

I'm trying to use your branch @danialcheung. I added this to pyproject:

streamlit-aggrid = { git = "https://github.com/danialcheung/streamlit-aggrid.git", branch = "danialcheung-marshallcomponentsexception-fix-1" }

But I get:

StreamlitAPIException: No such component directory: '/poetry/.venv/roadway-IgtDOu2o-py3.11/lib/python3.11/site-packages/st_aggrid/frontend/build'

Traceback:
File "/home/backend/streamlit_server.py", line 9, in <module>
    from st_aggrid import AgGrid, GridOptionsBuilder, GridUpdateMode, DataReturnMode
File "/poetry/.venv/roadway-IgtDOu2o-py3.11/lib/python3.11/site-packages/st_aggrid/__init__.py", line 92, in <module>
    _component_func = components.declare_component("agGrid", path=build_dir)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      

Any ideas on how I can use your fork while this isn't merged?

@danialcheung
Copy link
Author

@Ricardonacif Sadly I installed this over pip so I'm not familiar with running from source. Maybe try npm install inside the home directory and see if it builds the files?

@Ricardonacif
Copy link

I tried that, got a bunch of different errors :(

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

Successfully merging this pull request may close these issues.

AttributeError: module 'streamlit.components.v1' has no attribute 'components'
4 participants