You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error when setting rx.code_block with can_copy=True in the markdown component map #3880
Describe the bug
when setting rx.code_block with can_copy=True in the markdown component map, in the browser, an unhandled error will be raised. "ReferenceError: RadixThemesButton is not defined"
To Reproduce
Steps to reproduce the behavior:
component_map = {
"codeblock": lambda text, **props: rx.code_block(
text, **props, can_copy=True,
),
}
def index():
return rx.vstack(
rx.markdown(
r"""
\```python
import reflex as rx
component = rx.text("Hello World!")
\```
""",
component_map=component_map,
),
rx.code_block(
"""def fib(n):
if n <= 1:
return n
else:
return(fib(n-1) + fib(n-2))""",
language="python",
# can_copy=True, # If this is commented out, an unhandled error will be raised. ReferenceError: RadixThemesButton is not defined
),
)
app = rx.App()
app.add_page(index)
Expected behavior
The page should be rendered without an error.
Specifics (please complete the following information):
Python Version: 3.12.3
Reflex Version: 0.5.10
OS: Ubuntu 24.04
Additional context
If I include an rx.code_block with the can_copy=True flag on the same page, the page is rendered correctly.
Activity
Include child imports in markdown component_map
Include child imports in markdown component_map (#3883)
Include child imports in markdown component_map (reflex-dev#3883)
Include child imports in markdown component_map (#3883)
Use old serializer system in LiteralVar (#3875)
Fix type propagation in ToStringOperation (#3895)