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
When toasts are included in sync events, build error appears only in prod mode.
To reproduce
VERSION="v0.0.0"# ...rx.text(
f"v{VERSION} ({rx.config.environment.REFLEX_ENV_MODE.get().value})",
on_mouse_up=rx.set_clipboard(
f"v{VERSION}"
), # On Safari, async func are not allowed to access clipboard (see: https://github.com/reflex-dev/reflex/issues/4757#issue-2832833845)on_click=lambda: rx.toast.success(
"Version copied to clipboard"
),
)
Expected behavior
App builds.
Logs
Builds logs without rx.toast.provider():
File "/[root]/app/pages/template.py", line 140, in _wrapper
rx.text(
~~~~~~~^
f"v{VERSION} ({rx.config.environment.REFLEX_ENV_MODE.get().value})",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
size="1",
^^^^^^^^^
),
^
File "/[root]/.venv/lib/python3.13/site-packages/reflex/components/radix/themes/base.py", line 139, in create
component = super().create(*children, **props)
File "/[root]/.venv/lib/python3.13/site-packages/reflex/components/component.py", line 736, in create
return cls(children=children, **props)
File "/[root]/.venv/lib/python3.13/site-packages/reflex/components/component.py", line 491, in __init__
kwargs["event_triggers"][key] = EventChain.create(
~~~~~~~~~~~~~~~~~^
value=value,
^^^^^^^^^^^^
args_spec=component_specific_triggers[key],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
key=key,
^^^^^^^^
)
^
File "/[root]/.venv/lib/python3.13/site-packages/reflex/event.py", line 484, in create
result = call_event_fn(value, args_spec, key=key)
File "/[root]/.venv/lib/python3.13/site-packages/reflex/event.py", line 1494, in call_event_fn
out = fn(*[*parsed_args][:number_of_fn_args])
File "/[root]/app/pages/template.py", line 146, in <lambda>
on_click=lambda: rx.toast.success(
~~~~~~~~~~~~~~~~^
"Version copied to clipboard"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
),
^
File "/[root]/.venv/lib/python3.13/site-packages/reflex/components/sonner/toast.py", line 328, in toast_success
return Toaster.send_toast(message, level="success", **kwargs)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/[root]/.venv/lib/python3.13/site-packages/reflex/components/sonner/toast.py", line 256, in send_toast
raise ValueError(
"Toaster component must be created before sending a toast. (use `rx.toast.provider()`)"
)
ValueError: Toaster component must be created before sending a toast. (use `rx.toast.provider()`)
Builds logs with rx.toast.provider():
Creating Production Build failed with exit code 1
> export-sitemap
> next build && next-sitemap
▲ Next.js 15.1.6
Linting and checking validity of types ...
Creating an optimized production build ...
✓ Compiled successfully
Collecting page data ...
Generating static pages (0/8) ...
ReferenceError: useEffect is not defined
at E (.next/server/pages/demo//review/edit.js:1:8700)
ReferenceError: useEffect is not defined
at y (.next/server/pages/user.js:1:2006)
Error occurred prerendering page "/demo//review/edit". Read more:
https://nextjs.org/docs/messages/prerender-error
ReferenceError: useEffect is not defined
[...]
Error occurred prerendering page "/user". Read more:
https://nextjs.org/docs/messages/prerender-error
ReferenceError: useEffect is not defined
[...]
Export encountered an error on /demo//review/edit, exiting the build.
⨯ Static worker exited with code: 1 and signal: null
Specifics (please complete the following information)
Python version: 3.13
Reflex Version: 0.7.0
OS: macOS 15.3 (24D60) plus Ubuntu 24.04
The text was updated successfully, but these errors were encountered:
Describe the bug
When toasts are included in sync events, build error appears only in
prod
mode.To reproduce
Expected behavior
App builds.
Logs
Builds logs without
rx.toast.provider()
:Builds logs with
rx.toast.provider()
:Specifics (please complete the following information)
The text was updated successfully, but these errors were encountered: