{"record":{"id":"3d553d7496613061","repo":"DioxusLabs/dioxus","slug":"lazy-loader-must-define-a-single-input-argument-to","errorCode":null,"errorMessage":"Lazy Loader must define a single input argument to satisfy the LazyLoader signature","messagePattern":"Lazy Loader must define a single input argument to satisfy the LazyLoader signature","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wasm-split/wasm-split-macro/src/lib.rs","lineNumber":133,"sourceCode":"\n/// Create a lazy loader for a given function. Meant to be used in statics. Designed for libraries to\n/// integrate with.\n///\n/// ```rust, ignore\n/// fn SomeFunction(args: Args) -> Ret {}\n///\n/// static LOADER: wasm_split::LazyLoader<Args, Ret> = lazy_loader!(SomeFunction);\n///\n/// LOADER.load().await.call(args)\n/// ```\n#[proc_macro]\npub fn lazy_loader(input: TokenStream) -> TokenStream {\n    // We can only accept idents/paths that will be the source function\n    let sig = parse_macro_input!(input as Signature);\n    let params = sig.inputs.clone();\n    let outputs = sig.output.clone();\n    let Some(FnArg::Typed(arg)) = params.first().cloned() else {\n        panic!(\n            \"Lazy Loader must define a single input argument to satisfy the LazyLoader signature\"\n        )\n    };\n    let arg_ty = arg.ty.clone();\n    let LoaderNames {\n        name,\n        split_loader_ident,\n        impl_import_ident,\n        impl_export_ident,\n        load_module_ident,\n        ..\n    } = LoaderNames::new(\n        sig.ident.clone(),\n        sig.abi\n            .as_ref()\n            .and_then(|abi| abi.name.as_ref().map(|f| f.value()))\n            .expect(\"abi to be module name\")\n            .to_string(),","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/wasm-split/wasm-split-macro/src/lib.rs#L115-L151","documentation":"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.","triggerScenarios":"Thrown at packages/wasm-split/wasm-split-macro/src/lib.rs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Define exactly one input argument on the lazy loader so it matches the LazyLoader signature."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}