Auto-launch debugger on error/crit/DEV if the env var is set.

This commit is contained in:
Enrico Ros
2025-05-12 14:09:25 -07:00
parent 77eb6fa97c
commit a55411c150
5 changed files with 33 additions and 2 deletions
+10 -1
View File
@@ -77,7 +77,16 @@ Test your application thoroughly using local development (refer to README.md for
## Debugging
We introduced the `/info/debug` page that provides a detailed overview of the application's environment, including the API keys, environment variables, and other configuration settings.
The application includes a client-side logging system. You can view recent logs via the UI (Settings > Tools > Logs).
For deeper debugging during development:
1. **Debug Page**: Access the `/info/debug` page for an overview of the application's environment, configuration, API status, and environment variables available to the client.
2. **Conditional Breakpoints**: To automatically pause execution in your browser's developer tools when critical errors (`error`, `critical`, `DEV` levels) are logged to the console, set the following environment variable in your local `.env.local` file and restart your development server:
```bash
NEXT_PUBLIC_DEBUG_BREAKS=true
```
This allows you to inspect the application state at the exact moment an important error occurs. This feature only works in development mode (`npm run dev`) and requires the environment variable to be explicitly set to `true`.
<br/>
+1
View File
@@ -150,6 +150,7 @@ The value of these variables are passed to the frontend (Web UI) - make sure the
| Variable | Description |
|:----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `NEXT_PUBLIC_DEBUG_BREAKS` | (optional, development) When set to 'true', enables automatic debugger breaks on DEV/error/critical logs in development builds |
| `NEXT_PUBLIC_MOTD` | Message of the Day - displays a dismissible banner at the top of the app (see [customizations](customizations.md) for the template variables). Example: 🔔 Welcome to our deployment! Version {{app_build_pkgver}} built on {{app_build_time}}. |
| `NEXT_PUBLIC_GA4_MEASUREMENT_ID` | (optional) The measurement ID for Google Analytics 4. (see [deploy-analytics](deploy-analytics.md)) |
| `NEXT_PUBLIC_POSTHOG_KEY` | (optional) Key for PostHog analytics. (see [deploy-analytics](deploy-analytics.md)) |