diff --git a/kayak_font/src/ttf/loader.rs b/kayak_font/src/ttf/loader.rs
index e45706bf460270a6a30a76359325000641c2fb3d..7e434e9f75a759805fdc7bd9180c4e3f1b5fa029 100644
--- a/kayak_font/src/ttf/loader.rs
+++ b/kayak_font/src/ttf/loader.rs
@@ -32,6 +32,7 @@ impl AssetLoader for TTFLoader {
         load_context: &'a mut LoadContext,
     ) -> BoxedFuture<'a, Result<(), anyhow::Error>> {
         Box::pin(async move {
+            #[cfg(not(target_family = "wasm"))]
             let asset_io = load_context
                 .asset_io()
                 .downcast_ref::<FileAssetIo>();