zeroclaw-labs/zeroclaw · error

channel-whatsapp-web-feature-missing-error

channel-whatsapp-web-feature-missing-error

Error message

WhatsApp Web channel requires the 'whatsapp-web' feature. Enable with: cargo build --features whatsapp-web (or, if installed to PATH: cargo install --path . --force --locked --features whatsapp-web)

What it means

The WhatsApp Web channel depends on the non-default `whatsapp-web` cargo feature (heavy native/protocol dependencies). When zeroclaw is built without it, a stub `Channel` implementation is compiled whose `send` fails immediately with this i18n-localized message (Fluent key `channel-whatsapp-web-feature-missing-error`). Nothing is wrong at runtime — the binary simply does not contain the WhatsApp Web code.

Source

Thrown at crates/zeroclaw-channels/src/whatsapp_web.rs:3305

    fn role(&self) -> ::zeroclaw_api::attribution::Role {
        ::zeroclaw_api::attribution::Role::Channel(
            ::zeroclaw_api::attribution::ChannelKind::WhatsappWeb,
        )
    }
    fn alias(&self) -> &str {
        "whatsapp"
    }
}

#[cfg(not(feature = "whatsapp-web"))]
#[async_trait]
impl Channel for WhatsAppWebChannel {
    fn name(&self) -> &str {
        "whatsapp"
    }

    async fn send(&self, _message: &SendMessage) -> Result<()> {
        anyhow::bail!(i18n::get_required_cli_string(
            "channel-whatsapp-web-feature-missing-error"
        ));
    }

    async fn listen(&self, _tx: tokio::sync::mpsc::Sender<ChannelMessage>) -> Result<()> {
        anyhow::bail!(i18n::get_required_cli_string(
            "channel-whatsapp-web-feature-missing-error"
        ));
    }

    async fn health_check(&self) -> bool {
        false
    }

    async fn start_typing(&self, _recipient: &str) -> Result<()> {
        anyhow::bail!(i18n::get_required_cli_string(
            "channel-whatsapp-web-feature-missing-error"
        ));

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Rebuild with the feature: `cargo build --features whatsapp-web` (add `--release` for release builds).
  2. For PATH installs, use the exact command from the message: `cargo install --path . --force --locked --features whatsapp-web`.
  3. Alternatively, remove the WhatsApp Web channel from config and use the Cloud API `whatsapp` channel, which needs no feature.

Example fix

# before
cargo build --release

# after
cargo build --release --features whatsapp-web
# for a PATH-installed binary:
cargo install --path . --force --locked --features whatsapp-web
Defensive patterns

Strategy: validation

Validate before calling

// Fail fast at startup instead of on first send
assert!(cfg!(feature = "whatsapp-web"),
    "config enables whatsapp-web but this binary was built without the feature");

Type guard

fn whatsapp_web_feature_enabled() -> bool {
    cfg!(feature = "whatsapp-web")
}

Try / catch

if let Err(e) = channel.send(&msg).await {
    if e.to_string().contains("whatsapp-web' feature") {
        anyhow::bail!("binary lacks whatsapp-web support; rebuild with cargo build --features whatsapp-web");
    }
    return Err(e);
}

Prevention

When it happens

Trigger: Configuring the WhatsApp channel in WhatsApp Web mode in a build produced without `--features whatsapp-web`, then calling `send` on it.

Common situations: Installing from a package or plain `cargo install`/`cargo build` without the feature flag; CI build flags differing from the local dev build; the feature accidentally dropped from an install script.

Related errors


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