|---|---|
| **Select platform:** | [iOS+](https://firebase.google.com/docs/crashlytics/ios/test-implementation.md.txt) [Android](https://firebase.google.com/docs/crashlytics/android/test-implementation.md.txt) [Web](https://firebase.google.com/docs/crashlytics/web/test-implementation.md.txt) [Flutter](https://firebase.google.com/docs/crashlytics/flutter/test-implementation.md.txt) [Unity](https://firebase.google.com/docs/crashlytics/unity/test-implementation.md.txt) |

<br />

> [!WARNING]
> **Preview:** Crashlytics for web apps is a **preview** release. A preview release is not subject to any SLA or deprecation policy and could change in backwards-incompatible ways.

Use this guide if you've followed the [getting started
guide](https://firebase.google.com/docs/crashlytics/web/get-started), and you're still not seeing crashes
in the Crashlytics dashboard.

> [!IMPORTANT]
> **Important:** Crashlytics support for web apps is rolling out over the next few days. If you don't yet see the experience in the Firebase console, check back soon!

## Force a crash to test your implementation

1. Add code to your app that you can use to force a test crash.

   Add a test button or route trigger to your React, Next.js, or Angular app
   that throws a runtime error when clicked:

   ```typescript
   // Trigger an unhandled exception on button click or route load
   function handleTestCrash() {
     throw new Error("Crashlytics Web SDK Test Unhandled Error!");
   }
   ```

   If you configured automatic error capturing with `<FirebaseCrashlytics>`
   (React or Next.js), `provideCrashlytics` (Angular), or `<CrashlyticsRoutes>`
   (React Router), throwing this error automatically captures the exception and
   schedules it for upload.
2. Build and run your app, then trigger the test error so that your app sends
   its first crash report to Firebase.

3. In the Firebase console, go to the
   **DevOps \& Engagement** \> **[**Crashlytics** dashboard](https://console.firebase.google.com/project/_/crashlytics)**
   to check for your test crash report:

   1. Select your web app from the drop-down selector at the top of the page.

   2. Refresh the page. Your test exception should appear in the **Issues**
      table within a few minutes.

If you've refreshed the console and you're still not seeing the test crash after
five to ten minutes, see the next section about troubleshooting your setup.

## Troubleshoot your setup

If you triggered a test crash and still don't see reports in the
Crashlytics dashboard after five to ten minutes, try re-running the
setup flow or verifying the following project configurations in the console:

- **Re-run the Crashlytics setup flow:** You can safely re-run the
  Firebase CLI setup command (`firebase crashlytics:setup`) or
  complete setup in the Firebase console as described in
  [Step 1 of the getting started guide](https://firebase.google.com/docs/crashlytics/web/get-started.md.txt#enable-crashlytics).
  Re-running setup automatically enables any missing APIs and repairs the
  `firebase-telemetry` Cloud Logging bucket and routing sink.

- **Check billing and IAM permissions:** Make sure that your Firebase project
  is on the [pay-as-you-go Blaze pricing plan](https://firebase.google.com/pricing.md.txt) and that your account has **Owner**
  permissions on the project when running the setup step.

- **Verify `firebasetelemetry.googleapis.com` API key restrictions:** In the
  Google Cloud console
  [**Credentials** page](https://console.cloud.google.com/apis/credentials),
  select the API key configured in your `firebaseConfig` object (for example,
  `Browser key (auto created by Firebase)`). If the key has API restrictions
  enabled, verify that **Firebase Telemetry API**
  (`firebasetelemetry.googleapis.com`) is included in the allowed APIs list. If
  this target is missing from a restricted API key, network upload requests fail
  with HTTP 403 (Forbidden) errors in your browser console.

- **Check enabled Google Cloud APIs:** In the Google Cloud console
  [**Enabled APIs \& services** page](https://console.cloud.google.com/apis/dashboard),
  verify that **Firebase Telemetry API** (`firebasetelemetry.googleapis.com`),
  **Firebase Telemetry Admin API** (`firebasetelemetryadmin.googleapis.com`),
  **Cloud Logging API** (`logging.googleapis.com`), and
  **Cloud Storage** (`storage.googleapis.com`) are enabled for your project.

- **Verify Log Analytics on the logging bucket:** In the Google Cloud console
  [**Logs Storage** page](https://console.cloud.google.com/logs/storage),
  verify that the `firebase-telemetry` bucket (`global` location) exists and has
  **Log Analytics** enabled, and check the
  [**Log Router** page](https://console.cloud.google.com/logs/router)
  to confirm that the `firebase-telemetry-routing` sink exists.

### Manually capture and flush a test exception

If you want to immediately verify end-to-end transmission without waiting for
memory batching or page unloads, use `recordError` along with `flush`:

```typescript
import { recordError, flush, getCrashlytics } from '@firebase/crashlytics';
import { app } from './lib/firebase'; // Shared initialization script

const crashlytics = getCrashlytics(app);

async function triggerImmediateTestCrash() {
  const error = new Error("Crashlytics Web SDK Test Handled Error!");
  // Capture the error with immediate priority and custom diagnostic metadata
  recordError(crashlytics, error, {
    priority: 'IMMEDIATE',
    testEvent: true,
    environment: 'staging_verification'
  });
  // Force an immediate upload before the browser terminates or reloads
  await flush(crashlytics);
  console.log("Test error flushed to Crashlytics successfully.");
}
```

## Next steps

- **[Get readable crash reports](https://firebase.google.com/docs/crashlytics/web/get-deobfuscated-reports.md.txt)**
  --- Set up automatic source map (`.js.map`) uploading so your production
  stack traces display original filenames and line numbers.

- **[Customize crash reports](https://firebase.google.com/docs/crashlytics/web/customize-crash-reports.md.txt)**
  --- Learn how to report handled exceptions, add custom keys, force flush
  telemetry records, and configure sampling.