DioxusLabs/dioxus · error

Failed to load wasm-split module

Error message

Failed to load wasm-split module

What it means

The generated wasm-split loader failed to fetch or instantiate the split wasm module at runtime. The lazy-loaded chunk (emitted as a separate wasm file by the CLI) could not be loaded when the loader was first invoked.

Solutions

  1. The split wasm module could not be loaded. Ensure it was built and is served; check the browser console and network tab.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/wasm-split/wasm-split-macro/src/lib.rs:104 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/09cae3c662e097ea. Report an issue: GitHub.

Appendix: source

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

                fn #load_module_ident (
                    callback: unsafe extern "C" fn(*const ::std::ffi::c_void, bool),
                    data: *const ::std::ffi::c_void
                );

                #[allow(improper_ctypes)]
                #[unsafe(no_mangle)]
                #import_sig;
            }

            thread_local! {
                static #split_loader_ident: wasm_split::LazySplitLoader = unsafe {
                    wasm_split::LazySplitLoader::new(#load_module_ident)
                };
            }

            // Initiate the download by calling the load_module_ident function which will kick-off the loader
            if !wasm_split::LazySplitLoader::ensure_loaded(&#split_loader_ident).await {
                panic!("Failed to load wasm-split module");
            }

            unsafe { #impl_import_ident( #(#args),* ) }.await
        }

        #[cfg(not(target_arch = "wasm32"))]
        #default_item
    }
    .into()
}

/// 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);

View on GitHub (pinned to 24f6a829df)