zeroclaw-labs/zeroclaw · error · anyhow::Error

WhatsApp channel requires the `whatsapp-web` feature

Error message

WhatsApp channel requires the `whatsapp-web` feature

What it means

Thrown by build_channel_by_id for whatsapp/whatsapp-web/whatsapp_web targets when the `whatsapp-web` cargo feature is not compiled. The web-client construction block is feature-gated; the cfg(not(feature = "whatsapp-web")) block bails with the feature name. Note this feature is named `whatsapp-web`, not `channel-whatsapp` — the prefix differs from the other channel gates.

Source

Thrown at crates/zeroclaw-channels/src/orchestrator/mod.rs:9158

                        cfg_arc
                            .read()
                            .channels
                            .whatsapp
                            .get(&alias)
                            .map(|wa| wa.allowed_groups.clone())
                            .unwrap_or_default()
                    })
                };
                let workspace_dir = one_shot_channel_workspace_dir(&config, "whatsapp", &alias);
                Ok(Arc::new(
                    WhatsAppWebChannel::new(wa, alias, peer_resolver, allowed_groups_resolver)
                        .with_persistence(config_arc.clone())
                        .with_workspace_dir(workspace_dir),
                ))
            }
            #[cfg(not(feature = "whatsapp-web"))]
            {
                anyhow::bail!("WhatsApp channel requires the `whatsapp-web` feature");
            }
        }
        #[cfg(feature = "channel-qq")]
        "qq" => {
            let qq = config
                .channels
                .qq
                .get("default")
                .context("QQ channel is not configured")?;
            let alias = "default".to_string();
            let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {
                let cfg_arc = config_arc.clone();
                let alias = alias.clone();
                Arc::new(move || cfg_arc.read().channel_external_peers("qq", &alias))
            };
            Ok(Arc::new(QQChannel::new(
                qq.app_id.clone(),
                qq.app_secret.clone(),

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Rebuild with `cargo build --features whatsapp-web`
  2. Use a prebuilt image that includes whatsapp-web support
  3. Or remove `[channels.whatsapp]` from config

Example fix

# before
cargo build --no-default-features --features "channel-telegram,channel-discord"
# error: WhatsApp channel requires the `whatsapp-web` feature

# after
cargo build --no-default-features --features "channel-telegram,channel-discord,whatsapp-web"
Defensive patterns

Strategy: validation

Validate before calling

#[cfg(not(feature = "whatsapp-web"))]
if config.channels.whatsapp.get("default").is_some() {
    log::warn!("[channels.whatsapp.default] configured but `whatsapp-web` feature is off");
}

Type guard

fn channel_feature_enabled(channel_type: &str) -> bool {
    match channel_type {
        "whatsapp" | "whatsapp-web" | "whatsapp_web" => cfg!(feature = "whatsapp-web"),
        "telegram" => cfg!(feature = "channel-telegram"),
        "discord" => cfg!(feature = "channel-discord"),
        "slack" => cfg!(feature = "channel-slack"),
        "mattermost" => cfg!(feature = "channel-mattermost"),
        "signal" => cfg!(feature = "channel-signal"),
        "matrix" => cfg!(feature = "channel-matrix"),
        _ => false,
    }
}

Try / catch

Err(err) if err.to_string().contains("requires the `whatsapp-web` feature") => {
    // note the non-standard prefix: rebuild with --features whatsapp-web (not channel-whatsapp)
}

Prevention

When it happens

Trigger: A `[channels.whatsapp.default]` section or `whatsapp.<alias>` send target on a binary built without `whatsapp-web`; reached during daemon startup channel construction or one-shot sends.

Common situations: Slim builds enabling only `channel-*` features while forgetting the differently-prefixed `whatsapp-web`; config migrated from a full-featured install to a minimal one; feature renamed across versions breaking build scripts.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/f22f2e2c006197da. Report an issue: GitHub.