> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vaile.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Solve common issues with your Vaile chat widget

## Overview

This guide helps you diagnose and resolve common issues with the Vaile chat widget. Follow these troubleshooting steps to get your widget working perfectly.

## Widget Not Appearing

### Initial Checks

<Steps>
  <Step title="Verify Installation">
    Check that the widget script is properly installed:

    ```html theme={null}
    <!-- Should be before </body> tag -->
    <script 
      src="https://embed.vaile.ai/chat-widget.iife.js"
      data-widget-key="YOUR_WIDGET_KEY"
      defer
    ></script>
    ```
  </Step>

  <Step title="Check Widget Key">
    Ensure your widget key is correct:

    * No quotes around the key
    * Correct format: `wk_xxxxxxxxxxxxx`
    * No extra spaces
  </Step>

  <Step title="Browser Console">
    Open Developer Tools (F12) and check for errors:

    * Red error messages
    * 404 (file not found)
    * Authentication errors
  </Step>

  <Step title="Network Tab">
    In DevTools Network tab, verify:

    * Widget script loads (200 status)
    * No blocked requests
    * HTTPS connection
  </Step>
</Steps>

### Common Causes

<AccordionGroup>
  <Accordion title="Script Placement Issues" icon="code">
    **Problem**: Script in wrong location

    **Solution**: Place script just before `</body>` tag, not in `<head>`

    ```html theme={null}
    <!-- Wrong -->
    <head>
      <script src="..."></script>
    </head>

    <!-- Correct -->
    <body>
      <!-- content -->
      <script src="..."></script>
    </body>
    ```
  </Accordion>

  <Accordion title="JavaScript Errors" icon="bug">
    **Problem**: Other scripts causing conflicts

    **Solutions**:

    * Check console for JavaScript errors
    * Try on a test page with no other scripts
    * Ensure jQuery conflicts are resolved
    * Update conflicting libraries
  </Accordion>

  <Accordion title="Ad Blockers" icon="shield">
    **Problem**: Browser extensions blocking widget

    **Solutions**:

    * Temporarily disable ad blockers
    * Whitelist your domain
    * Test in incognito mode
    * Check corporate firewall rules
  </Accordion>

  <Accordion title="CSS Conflicts" icon="paint-brush">
    **Problem**: Styles hiding the widget

    **Solutions**:

    * Check for `display: none` on body
    * Look for high z-index elements
    * Inspect widget container element
    * Remove conflicting CSS
  </Accordion>
</AccordionGroup>

## Widget Appears But Doesn't Work

### Functionality Issues

<Tabs>
  <Tab title="Can't Send Messages">
    **Symptoms**:

    * Type message but can't send
    * Send button doesn't work
    * Messages disappear

    **Solutions**:

    1. Check internet connection
    2. Verify widget key permissions
    3. Clear browser cache
    4. Check for console errors
    5. Test in different browser
  </Tab>

  <Tab title="No AI Responses">
    **Symptoms**:

    * Messages send but no reply
    * Typing indicator stuck
    * Generic error messages

    **Solutions**:

    1. Check account status in dashboard
    2. Verify API limits not exceeded
    3. Test widget key in dashboard
    4. Check service status page
    5. Contact support if persistent
  </Tab>

  <Tab title="Widget Freezes">
    **Symptoms**:

    * Unresponsive to clicks
    * Can't close widget
    * Animations stuck

    **Solutions**:

    1. Refresh the page
    2. Clear browser storage
    3. Disable browser extensions
    4. Check for memory issues
    5. Update browser to latest
  </Tab>
</Tabs>

## Display Issues

### Visual Problems

<CardGroup cols={2}>
  <Card title="Wrong Position" icon="arrows">
    **Problem**: Widget in wrong spot

    **Fix**: Check for CSS conflicts

    ```css theme={null}
    /* Override positioning */
    .vaile-widget-container {
      position: fixed !important;
      bottom: 20px !important;
      right: 20px !important;
    }
    ```
  </Card>

  <Card title="Cut Off Text" icon="scissors">
    **Problem**: Messages truncated

    **Fix**: Viewport settings

    ```html theme={null}
    <meta name="viewport" 
      content="width=device-width, 
      initial-scale=1">
    ```
  </Card>
</CardGroup>

### Style Conflicts

Common CSS conflicts and fixes:

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Issue</TableHead>
      <TableHead>Cause</TableHead>
      <TableHead>Solution</TableHead>
    </TableRow>
  </TableHeader>

  <TableBody>
    <TableRow>
      <TableCell>Widget too small</TableCell>
      <TableCell>Global box-sizing</TableCell>
      <TableCell>Add widget-specific rules</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Wrong fonts</TableCell>
      <TableCell>Global font overrides</TableCell>
      <TableCell>Increase specificity</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Broken layout</TableCell>
      <TableCell>CSS framework conflicts</TableCell>
      <TableCell>Isolate widget styles</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Hidden elements</TableCell>
      <TableCell>Display properties</TableCell>
      <TableCell>Check computed styles</TableCell>
    </TableRow>
  </TableBody>
</Table>

## Performance Issues

### Slow Loading

<Steps>
  <Step title="Check Network Speed">
    Use DevTools Network tab:

    * Widget load time
    * File size
    * Connection speed
  </Step>

  <Step title="Optimize Page">
    Reduce overall page weight:

    * Compress images
    * Minify scripts
    * Enable caching
    * Use CDN
  </Step>

  <Step title="Lazy Load Widget">
    Load widget after page:

    ```javascript theme={null}
    window.addEventListener('load', () => {
      setTimeout(() => {
        // Load widget script
      }, 2000);
    });
    ```
  </Step>
</Steps>

### High Memory Usage

Signs and solutions:

<AccordionGroup>
  <Accordion title="Memory Leaks" icon="memory">
    **Symptoms**: Page slows over time

    **Solutions**:

    * Update to latest widget version
    * Clear chat history periodically
    * Refresh page after long sessions
    * Check for console errors
  </Accordion>

  <Accordion title="CPU Usage" icon="microchip">
    **Symptoms**: Fan noise, lag

    **Solutions**:

    * Disable animations
    * Reduce polling frequency
    * Close unused tabs
    * Update graphics drivers
  </Accordion>
</AccordionGroup>

## Mobile-Specific Issues

### Common Mobile Problems

<Tabs>
  <Tab title="Not Responsive">
    **Issue**: Widget doesn't adapt to mobile

    **Fixes**:

    * Add viewport meta tag
    * Check responsive breakpoints
    * Test orientation changes
    * Verify touch events work
  </Tab>

  <Tab title="Keyboard Issues">
    **Issue**: Keyboard covers chat

    **Fixes**:

    * Update widget version
    * Check viewport settings
    * Test different keyboards
    * Report device-specific issues
  </Tab>

  <Tab title="Can't Close">
    **Issue**: X button not working

    **Fixes**:

    * Increase button size
    * Check touch target area
    * Remove conflicting handlers
    * Enable swipe-to-close
  </Tab>
</Tabs>

## Browser-Specific Issues

### Compatibility Problems

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Browser</TableHead>
      <TableHead>Common Issue</TableHead>
      <TableHead>Solution</TableHead>
    </TableRow>
  </TableHeader>

  <TableBody>
    <TableRow>
      <TableCell>Safari</TableCell>
      <TableCell>Widget position fixed</TableCell>
      <TableCell>Add -webkit- prefixes</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Firefox</TableCell>
      <TableCell>Font rendering</TableCell>
      <TableCell>Specify font stack</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Edge</TableCell>
      <TableCell>Smooth scroll</TableCell>
      <TableCell>Polyfill if needed</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>Chrome</TableCell>
      <TableCell>Extension conflicts</TableCell>
      <TableCell>Test in guest mode</TableCell>
    </TableRow>
  </TableBody>
</Table>

## Integration Issues

### CMS-Specific Problems

<AccordionGroup>
  <Accordion title="WordPress" icon="wordpress">
    **Common Issues**:

    * Plugin conflicts
    * Theme overrides
    * Cache problems

    **Solutions**:

    * Use Code Snippets plugin
    * Clear all caches
    * Check theme footer.php
    * Disable plugins one by one
  </Accordion>

  <Accordion title="Shopify" icon="cart-shopping">
    **Common Issues**:

    * Checkout page conflicts
    * Theme updates removing code
    * App conflicts

    **Solutions**:

    * Use theme.liquid file
    * Create backup of changes
    * Test all page types
    * Check app compatibility
  </Accordion>

  <Accordion title="Wix" icon="wand-magic-sparkles">
    **Common Issues**:

    * Editor preview differs
    * Mobile view problems
    * Custom code limits

    **Solutions**:

    * Publish to see changes
    * Use Wix dashboard
    * Check mobile editor
    * Upgrade plan if needed
  </Accordion>
</AccordionGroup>

## Error Messages

### Common Errors and Fixes

<Warning>
  Always check the browser console (F12) for specific error messages
</Warning>

<Tabs>
  <Tab title="401 Unauthorized">
    **Meaning**: Invalid widget key

    **Solutions**:

    * Verify key in dashboard
    * Check for typos
    * Regenerate if needed
    * Ensure account active
  </Tab>

  <Tab title="404 Not Found">
    **Meaning**: Script URL wrong

    **Solutions**:

    * Check script URL
    * Verify HTTPS
    * Clear DNS cache
    * Try direct URL access
  </Tab>

  <Tab title="500 Server Error">
    **Meaning**: Service issue

    **Solutions**:

    * Check status page
    * Wait and retry
    * Contact support
    * Check for updates
  </Tab>

  <Tab title="CORS Error">
    **Meaning**: Cross-origin blocked

    **Solutions**:

    * Verify domain settings
    * Check HTTPS usage
    * Add to allowed domains
    * Contact support
  </Tab>
</Tabs>

## Debug Mode

### Enable Detailed Logging

Add debug parameter to widget:

```html theme={null}
<script 
  src="https://widget.vaile.ai/chat-widget.iife.js"
  data-widget-key="YOUR_WIDGET_KEY"
  data-debug="true"
  defer
></script>
```

This provides:

* Detailed console logs
* Network request info
* Error stack traces
* Performance metrics

<Note>
  Only use debug mode during troubleshooting, not in production
</Note>

## Getting Help

### Before Contacting Support

<Checklist>
  <Check>Try all relevant troubleshooting steps</Check>
  <Check>Check browser console for errors</Check>
  <Check>Test in incognito/private mode</Check>
  <Check>Try different browser</Check>
  <Check>Document error messages</Check>
  <Check>Note browser/device info</Check>
</Checklist>

### Information to Provide

When contacting support, include:

1. **Widget key** (first 8 characters)
2. **Website URL** where issue occurs
3. **Browser** and version
4. **Device** type (desktop/mobile)
5. **Error messages** (screenshots)
6. **Steps to reproduce**
7. **What you've tried**

### Support Channels

<CardGroup cols={2}>
  <Card title="Email Support" icon="envelope">
    [support@vaile.ai](mailto:support@vaile.ai)

    * 24-48 hour response
    * Detailed assistance
    * File attachments
  </Card>

  <Card title="Dashboard Chat" icon="comments">
    Live chat in dashboard

    * Business hours
    * Quick questions
    * Real-time help
  </Card>
</CardGroup>

## Preventive Measures

### Best Practices

<AccordionGroup>
  <Accordion title="Regular Testing" icon="vial">
    * Test after site updates
    * Check different browsers
    * Monitor error logs
    * Verify mobile experience
  </Accordion>

  <Accordion title="Stay Updated" icon="arrows-rotate">
    * Widget auto-updates
    * Check for announcements
    * Review changelog
    * Test new features
  </Accordion>

  <Accordion title="Monitor Performance" icon="chart-line">
    * Check load times
    * Watch error rates
    * Track engagement
    * Review analytics
  </Accordion>
</AccordionGroup>

## Quick Reference

### Troubleshooting Checklist

<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Step</TableHead>
      <TableHead>Action</TableHead>
      <TableHead>✓</TableHead>
    </TableRow>
  </TableHeader>

  <TableBody>
    <TableRow>
      <TableCell>1</TableCell>
      <TableCell>Check widget appears</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>2</TableCell>
      <TableCell>Verify console errors</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>3</TableCell>
      <TableCell>Test in incognito</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>4</TableCell>
      <TableCell>Check mobile view</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>5</TableCell>
      <TableCell>Clear cache</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>6</TableCell>
      <TableCell>Contact support</TableCell>
      <TableCell>\[ ]</TableCell>
    </TableRow>
  </TableBody>
</Table>

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation Guide" icon="wrench" href="/installation/widget-installation">
    Review installation steps
  </Card>

  <Card title="Contact Support" icon="headset" href="mailto:support@vaile.ai">
    Get personalized help
  </Card>
</CardGroup>
