# Channels diagnostics

<!-- Generated by docs/modules/diagnostics from the package catalogs. Write a guide in docs/diagnostics/<CODE>.md instead of editing this file. -->

Each Channels error has a stable `code`. Its `docs` link opens the page of that code. This page lists all 13 codes, and [All diagnostics](https://vitehub.dev/docs/reference/diagnostics) lists every primitive.

## Runtime errors

| Code | What happened |
| --- | --- |
| [`CHANNELS_R0002`](https://vitehub.dev/docs/channels/diagnostics/channels_r0002) | No Channel Definition was discovered for "\<name\>". |
| [`CHANNELS_R0003`](https://vitehub.dev/docs/channels/diagnostics/channels_r0003) | `useChannel()` requires a non-empty channel name. |

## Configuration errors

| Code | What happened |
| --- | --- |
| [`CHANNELS_C0001`](https://vitehub.dev/docs/channels/diagnostics/channels_c0001) | `defineChannel()` expects an object with an `adapter`. |
| [`CHANNELS_C0007`](https://vitehub.dev/docs/channels/diagnostics/channels_c0007) | `defineChannel()` needs an `adapter` with a non-empty `kind`, such as `stripe()` or `webhook()` from `vite-hub/channels`, `slack()` from `vite-hub/agent/channels`, or `{ kind, send }`. |
| [`CHANNELS_C0008`](https://vitehub.dev/docs/channels/diagnostics/channels_c0008) | The "\<kind\>" adapter `send` must be a function. |
| [`CHANNELS_C0009`](https://vitehub.dev/docs/channels/diagnostics/channels_c0009) | `defineChannel({ on })` expects an object of targets by event name. |
| [`CHANNELS_C0010`](https://vitehub.dev/docs/channels/diagnostics/channels_c0010) | The `on` handler "\<name\>" needs an adapter that receives webhooks, such as `webhook()` or `stripe()`. The "\<kind\>" adapter sends its messages to the Agent that lists the Channel. Use `defineChannelTrigger()` for a custom trigger. |
| [`CHANNELS_C0011`](https://vitehub.dev/docs/channels/diagnostics/channels_c0011) | The "\<kind\>" webhook adapter \<problem\>. \<fix\> |

## Build errors

| Code | What happened |
| --- | --- |
| [`CHANNELS_B0001`](https://vitehub.dev/docs/channels/diagnostics/channels_b0001) | The Channel "\<name\>" receives webhooks, which the Agent webhook route serves. Set `agent: true` next to `channels: true` in vitehub(), and install @vite-hub/agent. |

## Errors

| Code | What happened |
| --- | --- |
| [`CHANNEL_DEFINITION_FAILED`](https://vitehub.dev/docs/channels/diagnostics/channel_definition_failed) | The Channel Definition "\<channel\>" is missing or failed to load. |
| [`CHANNEL_INVALID_SEND`](https://vitehub.dev/docs/channels/diagnostics/channel_invalid_send) | See the page of the code. |
| [`CHANNEL_SEND_FAILED`](https://vitehub.dev/docs/channels/diagnostics/channel_send_failed) | The "\<kind\>" adapter of Channel "\<channel\>" failed to send the message.\<value\> |
| [`CHANNEL_TRIGGER_FAILED`](https://vitehub.dev/docs/channels/diagnostics/channel_trigger_failed) | The trigger "\<trigger\>" of Channel "\<channel\>" could not start. |

<!-- vitehub-docs:section-links -->
## In this section

- [Overview](https://vitehub.dev/raw/docs/channels.md)
- [Get started](https://vitehub.dev/raw/docs/channels/get-started.md)
- [Server API](https://vitehub.dev/raw/docs/channels/server-api.md)
- [Agent capability](https://vitehub.dev/raw/docs/channels/agent-capability.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
