# Debugging

Not sure why a Widget or Survey isn't showing? Call `Frill('help')` to get a summary of all Frill instances including user details.

### Preview mode

When preview mode is enabled all Surveys will show regardless of Location or Frequency rules. Submitting the Survey preview mode will not record the response. This is a good way to see how a Survey will appear if you have already submitted it.

```typescript
// All surveys will load in preview mode
window.Frill('container', {
  key: 'YOUR_SCRIPT_KEY',
  previewMode: true,
});

// Load a single survey in preview mode
window.Frill('survey', {
  key: 'YOUR_SURVEY_KEY',
  previewMode: true,
});
```

{% hint style="info" %}
A Survey will not appear if it has Audience rules (segmentation) and you have not identified a user in that segment, unless the Survey was loaded manually with the `survey` command.
{% endhint %}

### Disable warnings

The Frill Script has additional developer warnings which can be disabled at any time.

```typescript
window.Frill('container', {
  key: 'YOUR_SCRIPT_KEY',
  disableWarnings: true,
});
```

### Error handling

To guard your application from any Frill related errors, you can guard callbacks by checking `window.Frill.ready` (which is set to `true` once the Frill SDK script has loaded). This should only be used if you are [manually loading](https://developers.frill.co/frill-script/widgets/manual-loading) (and opening/closing) widgets.

```tsx
<button type="button" onClick={() => {
  if (window.Frill?.ready) {
    // Show frill widget here...
    return;
  }
  
  // Otherwise, send user to frill portal
}}>
  Give feedback
</button>
```
