sipeed/picoclaw · error

whatsapp native not compiled in; build with -tags whatsapp_n

Error message

whatsapp native not compiled in; build with -tags whatsapp_native

What it means

Returned by the stub NewWhatsAppNativeChannel (whatsapp_native_stub.go, compiled only without the whatsapp_native build tag) when the binary was not built with whatsmeow support. The real implementation lives behind //go:build whatsapp_native because the whatsmeow dependency (and its CGO sqlite driver) is opt-in; the stub keeps the channel registry compilable without it.

Source

Thrown at pkg/channels/whatsapp_native/whatsapp_native_stub.go:27

	"github.com/sipeed/picoclaw/pkg/channels"
	"github.com/sipeed/picoclaw/pkg/config"
)

// NewWhatsAppNativeChannel returns an error when the binary was not built with -tags whatsapp_native.
// Build with: go build -tags whatsapp_native ./cmd/...
func NewWhatsAppNativeChannel(
	bc *config.Channel,
	name string,
	cfg *config.WhatsAppSettings,
	bus *bus.MessageBus,
	storePath string,
) (channels.Channel, error) {
	_ = bc
	_ = name
	_ = cfg
	_ = bus
	_ = storePath
	return nil, fmt.Errorf("whatsapp native not compiled in; build with -tags whatsapp_native")
}

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Rebuild with the tag: go build -tags whatsapp_native ./... (and CGO settings per the sqlite driver, if required).
  2. Or remove/disable the whatsapp_native channel entry from config if the bridge-based whatsapp channel suffices.
  3. Check the project README/build scripts for the exact tag/builder invocation for the WhatsApp-native feature.

Example fix

# before
go build ./cmd/picoclaw
# after
go build -tags whatsapp_native ./cmd/picoclaw
Defensive patterns

Strategy: validation

Validate before calling

// Detect the stub before configuring the channel:
if _, err := whatsapp_native.NewWhatsAppNativeChannel(nil, "", nil, nil, ""); err != nil {
    if strings.Contains(err.Error(), "build with -tags whatsapp_native") {
        return errors.New("this binary lacks whatsapp_native support; rebuild with the tag or disable the channel")
    }
}

Try / catch

if _, err := whatsapp_native.NewWhatsAppNativeChannel(bc, name, cfg, bus, storePath); err != nil {
    if strings.Contains(err.Error(), "not compiled in") {
        // build-time problem: rebuild with -tags whatsapp_native
    }
}

Prevention

When it happens

Trigger: Channel config enables a whatsapp_native channel but the binary was built plainly ('go build' without '-tags whatsapp_native'), so the constructor resolves to the stub and always returns this error.

Common situations: Installing a distro/packaged picoclaw binary built without the tag; CI building default targets; developers adding the native channel to config without rebuilding with the tag.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/27a2d99a24f55681. Report an issue: GitHub.