## TL;DR

For "// drops everything that is not a TypeError": add a temporary log line inside beforeSend printing the event ID and the return value. Remove the log line, keep the explicit return, and confirm events flow.

```text
// drops everything that is not a TypeError
Sentry.init({
  beforeSend(event) {
    if (event.exception.values[0].type === "TypeError") {
      return event;
    }
    // implicit undefined for everything else
  },
});
```

## Steps

1. `beforeSend` must return the event. If it returns `null` or `undefined`, the event is discarded silently, by design. The usual ways this happens:

```js
// drops EVERYTHING: no return statement
Sentry.init({
 beforeSend(event) {
 scrub(event);
 },
});
```

```js
// drops everything that is not a TypeError
Sentry.init({
 beforeSend(event) {
 if (event.exception.values[0].type === "TypeError") {
 return event;
 }
 // implicit undefined for everything else
 },
});
```

2. Arrow-function bodies without braces have the same trap: `beforeSend: (e) => { scrub(e); }` returns undefined.

3. Always return the event at the end, and return `null` only deliberately:

```js
beforeSend(event) {
 scrub(event);
 if (shouldIgnore(event)) return null; // deliberate drop
 return event; // everything else ships
}
```

4. Add a temporary log line inside `beforeSend` printing the event ID and the return value. If the log fires but nothing arrives, the hook is eating events. If the log never fires, the problem is earlier (init order, DSN, transport).

5. Remove the log line, keep the explicit return, and confirm events flow. As a rule, treat any `beforeSend` without a final `return event` as a bug during code review.

## When to use

You are seeing this: No errors in the SDK logs, no failed requests, no quota issues. Use this skill when you run into "Fix: beforeSend silently dropping every event".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

beforeSend must return the event.
