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.
Describe the bug
when setting
rx.code_blockwithcan_copy=Truein 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:
Expected behavior
The page should be rendered without an error.
Specifics (please complete the following information):
Additional context
If I include an
rx.code_blockwith thecan_copy=Trueflag on the same page, the page is rendered correctly.