thunderbug1 / streamlit-javascript

Streamlit component to execute javascript code on the client side and get back the result
MIT License
102 stars 3 forks source link

Component not being loaded on Cloud Run #15

Closed andreasntr closed 10 months ago

andreasntr commented 10 months ago

When deploying an app on Google Cloud Run, the following error shows when executing any st_javascript script. Using Streamlit Community Cloud or localhost, the app works without problems.

st_javascript call:

st_javascript('''[window.innerWidth, parent.window.innerHeight];''', key=...)

Dokerfile:

#Base Image to use
FROM python:3.10-slim

#Expose port 8080
EXPOSE 8080

#Copy Requirements.txt file into app directory
COPY requirements.txt app/requirements.txt

#install all requirements in requirements.txt
RUN python -m pip install --upgrade pip && pip install -r app/requirements.txt

#Copy all files in current directory into app directory
COPY . /app

#Change Working Directory to app directory
WORKDIR /app

#Run the application on port 8080
ENTRYPOINT ["streamlit", "run", "app.py", \
  "--server.port=8080", \
  "--client.showErrorDetails=false", \
  "--client.toolbarMode=viewer"]
andreasntr commented 10 months ago

Closing, seems like a Cloud Run issue with JS components. Also happens with similar components