{"record":{"id":"27a2d99a24f55681","repo":"sipeed/picoclaw","slug":"whatsapp-native-not-compiled-in-build-with-tags","errorCode":null,"errorMessage":"whatsapp native not compiled in; build with -tags whatsapp_native","messagePattern":"whatsapp native not compiled in; build with -tags whatsapp_native","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/whatsapp_native/whatsapp_native_stub.go","lineNumber":27,"sourceCode":"\t\"github.com/sipeed/picoclaw/pkg/channels\"\n\t\"github.com/sipeed/picoclaw/pkg/config\"\n)\n\n// NewWhatsAppNativeChannel returns an error when the binary was not built with -tags whatsapp_native.\n// Build with: go build -tags whatsapp_native ./cmd/...\nfunc NewWhatsAppNativeChannel(\n\tbc *config.Channel,\n\tname string,\n\tcfg *config.WhatsAppSettings,\n\tbus *bus.MessageBus,\n\tstorePath string,\n) (channels.Channel, error) {\n\t_ = bc\n\t_ = name\n\t_ = cfg\n\t_ = bus\n\t_ = storePath\n\treturn nil, fmt.Errorf(\"whatsapp native not compiled in; build with -tags whatsapp_native\")\n}\n","sourceCodeStart":9,"sourceCodeEnd":29,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/whatsapp_native/whatsapp_native_stub.go#L9-L29","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rebuild with the tag: go build -tags whatsapp_native ./... (and CGO settings per the sqlite driver, if required).","Or remove/disable the whatsapp_native channel entry from config if the bridge-based whatsapp channel suffices.","Check the project README/build scripts for the exact tag/builder invocation for the WhatsApp-native feature."],"exampleFix":"# before\ngo build ./cmd/picoclaw\n# after\ngo build -tags whatsapp_native ./cmd/picoclaw","handlingStrategy":"validation","validationCode":"// Detect the stub before configuring the channel:\nif _, err := whatsapp_native.NewWhatsAppNativeChannel(nil, \"\", nil, nil, \"\"); err != nil {\n    if strings.Contains(err.Error(), \"build with -tags whatsapp_native\") {\n        return errors.New(\"this binary lacks whatsapp_native support; rebuild with the tag or disable the channel\")\n    }\n}","typeGuard":null,"tryCatchPattern":"if _, err := whatsapp_native.NewWhatsAppNativeChannel(bc, name, cfg, bus, storePath); err != nil {\n    if strings.Contains(err.Error(), \"not compiled in\") {\n        // build-time problem: rebuild with -tags whatsapp_native\n    }\n}","preventionTips":["Build with '-tags whatsapp_native' whenever the channel config may enable it.","Fail fast at config-load time if the channel is enabled but the stub is compiled in.","Document required build tags next to the channel config in deployment docs."],"tags":["whatsapp","build-tags","compile-time","stub"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}