Deployment with declare_component

Hi, community
I’ve set up an app with the components.declare_component. Here is the snippet:

import os

import streamlit.components.v1 as components


_RELEASE = True
if not _RELEASE:
    _component_func = components.declare_component(
        "root_component",
        url="http://localhost:5300",
    )
else:
    parent_dir = os.path.dirname(os.path.abspath(__file__))
    _component_func = components.declare_component(
        "root_component",
        url="https://resume-matcher.netlify.app/",
    )

def root_component(data, key=None) -> dict[str, str]:
    component_value = _component_func(data=data, key=key, default=0)
    return component_value

As you can see, the url is used for declaration, but it doesn’t show up in the browser properly. The iframe loads when I open the dev tools on the Chrome browser.

  1. Here is my app.
  2. Here is my repo

How can I resolve the issue? Thanks.

Best,

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