Skip to content

MarshallComponentsException Fix#280

Open
danialcheung wants to merge 1 commit intoPablocFonseca:mainfrom
danialcheung:danialcheung-marshallcomponentsexception-fix-1
Open

MarshallComponentsException Fix#280
danialcheung wants to merge 1 commit intoPablocFonseca:mainfrom
danialcheung:danialcheung-marshallcomponentsexception-fix-1

Conversation

@danialcheung
Copy link
Copy Markdown

@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
Copy Markdown

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

@mistlet0e
Copy link
Copy Markdown

Yes please, this would be really helpful for my project

@Ricardonacif
Copy link
Copy Markdown

Pretty please :D

@Ricardonacif
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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