# Troubleshooting

> From the symptom you see to the cause and the fix.

| symptom | cause and fix |
|---|---|
| `JoinError` `origin` (403) | The page's origin is not one your app allows. Check the exact scheme, host and port (`http://localhost:5173` is not `http://127.0.0.1:5173`); a `file://` page has none. Add the origin under your app's settings. |
| `JoinError` `unknown_app` (403) | Unknown key: check for a typo or a key from another environment. |
| `JoinError` `bad_room` (400) | The room name has characters outside `[A-Za-z0-9_-]` or is over 64 long. |
| `JoinError` `room_full` (409) | The room is at its limit; retry every 2 to 3 seconds ([lifecycle](https://jsflow.com/docs/concepts/lifecycle.md)). |
| `JoinError` `rate` (429) | Too many joins a minute from this IP or app; back off. |
| `JoinError` `too_many_rooms` or `too_many_streams` (429) | Your app is at its room limit, or this IP has too many open connections. |
| `JoinError` `ticket_required`, `ticket_invalid` or `ticket_expired` | The app requires join tickets. Pass a ticket from your backend as `join({ ticket })`, a function so that every `join()` call gets a fresh one; check its `app`, `room` and expiry. |
| `JoinError` `blocked` (403) or the `evicted` state | Your backend evicted or blocked this user. Joining is refused until the block ends. |
| `JoinError` `quota` (402) or the `suspended` state | The account's spend cap is reached: links stay up, but new joins to the account's apps are refused (`quota`) until an owner raises the cap or the next period starts. |
| `JoinError` `wire` | The room runs the other wire version: a 0.1 page and a 1.0 page cannot share a room. Ship 1.0 to every client, or give 1.0 rooms new names (see [what changed](https://jsflow.com/docs/reference/changelog.md)). |
| `JoinError` `sdk_unsupported` | The SDK is older than the service accepts: update it. |
| `JoinError` `unsupported_browser` (status 0) | The browser has no Web Crypto X25519 or Ed25519. Use Chrome or Edge 137, Safari 17 or Firefox 130 or newer. |
| `JoinError` `worker_failed` (status 0) | The SDK's worker did not start, twice, on a busy device. Joining again usually works; with the CDN, check that `worker.js` is served next to `jsflow.js`. |
| a `TypeError` such as "Failed to fetch" | The service was not reachable: the network, or a Content-Security-Policy without the `connect-src` entries in [loading the SDK](https://jsflow.com/docs/guides/loading-the-sdk.md). |
| a red "Failed to load resource … 409" for `/v2/join` in the console, then the join succeeds | Normal, nothing to fix: the room lives on another jsflow server, which the first answer (`409 wrong_home`) names, and the SDK repeats the join there. The browser logs every 4xx answer, even one the SDK handles. |
| stuck in `joining` | Alone in the room (normal), or WebRTC is blocked: check the console. On networks that block UDP the relay falls back to TCP and TLS on port 443. |
| CSP errors in the console (`worker-src`, `connect-src`) | Add the entries in [loading the SDK](https://jsflow.com/docs/guides/loading-the-sdk.md). |
| a bundler error about `https://cdn.jsflow.com/…` | Import at runtime with the bundler's ignore comment ([loading the SDK](https://jsflow.com/docs/guides/loading-the-sdk.md)). |
| messages arrive but a few broadcasts are missing | Expected now and then: number them and repair gaps ([choosing how to send](https://jsflow.com/docs/concepts/choosing-how-to-send.md)). |
| `undelivered` events | The peer was unreachable for 30 seconds or reloaded; resend what still matters to its new id. |
| a peer's id changed | It reloaded or joined again; ids are per join ([rooms, peers and keys](https://jsflow.com/docs/concepts/rooms-peers-keys.md)). |

`onMetric(name, value, detail?)` gives jsflow's diagnostic measurements (`wake`, `rejoined`, `link`, …; `value` is a number, 1 for an event, and `detail` holds the data) if you want them in your logs when reporting a problem. Their names may change in any minor release.

A `JoinError` has `status` and `code` fields, the same words the dashboard's log shows for a refused join. Every code and what to do about it is on the [error codes](https://jsflow.com/docs/reference/errors.md) page.

Source: https://jsflow.com/docs/guides/troubleshooting/
