From 8e63ccc23bb5f97da6273e373b2035106158bc57 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Sun, 12 Apr 2026 10:30:26 -0400 Subject: [PATCH] fix: enable getrandom js feature for WASM compilation The getrandom crate (transitive dep via rand/argon2) requires the "js" feature flag to compile for wasm32-unknown-unknown targets. Co-Authored-By: Claude Opus 4.6 (1M context) --- Cargo.lock | 3 +++ crates/idfoto-wasm/Cargo.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f1e3c34..ac775d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -552,8 +552,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -625,6 +627,7 @@ name = "idfoto-wasm" version = "0.1.0" dependencies = [ "data-encoding", + "getrandom", "hmac", "idfoto-core", "js-sys", diff --git a/crates/idfoto-wasm/Cargo.toml b/crates/idfoto-wasm/Cargo.toml index bd659c8..efd3f53 100644 --- a/crates/idfoto-wasm/Cargo.toml +++ b/crates/idfoto-wasm/Cargo.toml @@ -15,6 +15,7 @@ serde_json = "1" hmac = "0.12" sha1 = "0.10" data-encoding = "2" +getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] wasm-bindgen-test = "0.3"