DioxusLabs/dioxus · error

Lazy Loader must define a single input argument to satisfy…

Error message

Lazy Loader must define a single input argument to satisfy the LazyLoader signature

What it means

The lazy_loader! macro was given a function signature whose input count is not exactly one. The LazyLoader<Args, Ret> contract requires a single argument parameter, so signatures with zero or multiple inputs panic at macro expansion.

Solutions

  1. Define exactly one input argument on the lazy loader so it matches the LazyLoader signature.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/wasm-split/wasm-split-macro/src/lib.rs:133 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/3d553d7496613061. Report an issue: GitHub.

Appendix: source

Thrown at packages/wasm-split/wasm-split-macro/src/lib.rs:133

/// Create a lazy loader for a given function. Meant to be used in statics. Designed for libraries to
/// integrate with.
///
/// ```rust, ignore
/// fn SomeFunction(args: Args) -> Ret {}
///
/// static LOADER: wasm_split::LazyLoader<Args, Ret> = lazy_loader!(SomeFunction);
///
/// LOADER.load().await.call(args)
/// ```
#[proc_macro]
pub fn lazy_loader(input: TokenStream) -> TokenStream {
    // We can only accept idents/paths that will be the source function
    let sig = parse_macro_input!(input as Signature);
    let params = sig.inputs.clone();
    let outputs = sig.output.clone();
    let Some(FnArg::Typed(arg)) = params.first().cloned() else {
        panic!(
            "Lazy Loader must define a single input argument to satisfy the LazyLoader signature"
        )
    };
    let arg_ty = arg.ty.clone();
    let LoaderNames {
        name,
        split_loader_ident,
        impl_import_ident,
        impl_export_ident,
        load_module_ident,
        ..
    } = LoaderNames::new(
        sig.ident.clone(),
        sig.abi
            .as_ref()
            .and_then(|abi| abi.name.as_ref().map(|f| f.value()))
            .expect("abi to be module name")
            .to_string(),

View on GitHub (pinned to 24f6a829df)