DioxusLabs/dioxus · error
todo: convert_resize_data in dioxus-native. requires support
Error message
todo: convert_resize_data in dioxus-native. requires support in blitz
What it means
dioxus-native (the blitz-rendered native target) implements dioxus-html's HtmlEventConverter trait, but many conversions are stubs. convert_resize_data calls unimplemented!() because blitz does not yet deliver resize events, so any attempt to convert a platform resize event into the ResizeData an onresize handler expects panics at runtime. The panic happens when the event fires, not at compile time.
Source
Thrown at packages/native-dom/src/events.rs:134
fn convert_toggle_data(&self, _event: &PlatformEventData) -> ToggleData {
unimplemented!("todo: convert_toggle_data in dioxus-native. requires support in blitz")
}
fn convert_touch_data(&self, event: &PlatformEventData) -> TouchData {
event.downcast::<NativeTouchData>().unwrap().clone().into()
}
fn convert_transition_data(&self, _event: &PlatformEventData) -> TransitionData {
unimplemented!("todo: convert_transition_data in dioxus-native. requires support in blitz")
}
fn convert_wheel_data(&self, event: &PlatformEventData) -> WheelData {
event.downcast::<NativeWheelData>().unwrap().clone().into()
}
fn convert_resize_data(&self, _event: &PlatformEventData) -> ResizeData {
unimplemented!("todo: convert_resize_data in dioxus-native. requires support in blitz")
}
fn convert_visible_data(&self, _event: &PlatformEventData) -> VisibleData {
unimplemented!("todo: convert_visible_data in dioxus-native. requires support in blitz")
}
}
#[derive(Clone)]
pub struct NodeHandle {
pub(crate) doc: Rc<RefCell<BaseDocument>>,
pub(crate) node_id: NodeId,
}
impl NodeHandle {
pub fn node_id(&self) -> NodeId {
self.node_id
}
View on GitHub (pinned to 393d190a80)
Solutions
- Remove or cfg-gate the onresize handler when targeting dioxus-native
- Read element size through the MountedData/NodeHandle API (it exposes the blitz BaseDocument via doc()) instead of resize events
- Use the desktop (webview) or web renderer for this view, where resize events are supported
- Track dioxus-native/blitz for resize event support and upgrade once convert_resize_data is implemented
Example fix
// before: panics in dioxus-native when a resize event is converted
rsx! { div { onresize: move |_e| tracing::info!("resized"), "hi" } }
// after: only register the handler on renderers that support it
rsx! {
div {
#[cfg(not(feature = "dx-native"))] // adjust to your native feature flag
onresize: move |_e| tracing::info!("resized"),
"hi"
}
} Defensive patterns
Strategy: fallback
Validate before calling
// Render resize-dependent UI only on renderers that support resize events
fn supports_resize_events() -> bool {
cfg!(any(target_arch = "wasm32", feature = "desktop")) // adjust per your setup
} Type guard
fn supports_resize_events() -> bool {
cfg!(any(target_arch = "wasm32", feature = "desktop"))
} Prevention
- Check dioxus-native's NativeConverter for unimplemented event kinds before relying on an event in a native build
- Gate platform-specific event handlers with #[cfg(...)] inside rsx so unsupported renderers never register them
- Prefer the MountedData/NodeHandle geometry APIs over resize events for native targets
When it happens
Trigger: Building with the dioxus-native renderer and attaching an onresize handler (on a div or any element) that then receives a resize event; the VirtualDOM calls NativeConverter::convert_resize_data, which is an unimplemented!() stub.
Common situations: Porting a web or desktop app that relies on onresize to the native (blitz) renderer; using size-observation patterns (layout measurement, container queries) in a dioxus-native app before blitz gained resize event support.
Related errors
- todo: convert_visible_data in dioxus-native. requires suppor
- Callback was called after the runtime was dropped
- only an InputElement or TextAreaElement or an element with c
- expected URL to be UTF-8 encoded
- Failed to get asset manager
AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16).
Data as JSON: /api/errors/d076677ddfc5b6b0.
Report an issue: GitHub.