Quick Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| Audio not working | Audio context not initialized in user gesture | Call initializeAudioContext() in click/touch handler |
| Avatar not loading | Invalid/expired session token (SDK Mode only) | Refresh token (max 24 hours validity) |
| WASM MIME type error | Server misconfiguration | Use Vite plugin or configure MIME type manually |
| WebSocket failed (SDK Mode) | Network or auth issue | Check network and token |
| Low frame rate | WebGL fallback or device limits | Use Chrome/Edge for WebGPU support |
Installation Issues
Package installation failed
Package installation failed
Problem: Errors during Checklist:
npm/yarn/pnpm installSolution:- Node.js 18.0+ installed
- Network connection stable
- Using correct package name:
@spatialwalk/avatarkit
TypeScript type errors
TypeScript type errors
Problem: Type errors when using SDKSolution: Update Requirements:
tsconfig.json:- TypeScript 5.0+
- Correct
libincludes DOM
WASM file not loading
WASM file not loading
Problem: WASM MIME type error or 404Solution 1: Use Vite plugin (recommended)Solution 2: Manual configuration
Runtime Issues
SDK initialization failed
SDK initialization failed
Problem:
AvatarSDK.initialize() throws errorChecklist:- Valid App ID from SpatialReal Studio
- Network connection working
- Correct environment (
Environment.cnorEnvironment.intl) - SDK not already initialized
Avatar loading failed
Avatar loading failed
Problem:
AvatarManager.shared.load() returns nullChecklist:- SDK Mode only: Session token set before loading and not expired (max 24 hours)
- Avatar ID valid for your App ID
- Network connection stable
Audio not playing
Audio not playing
Problem: Avatar doesn’t respond to audioCause: Audio context not initialized in user gestureSolution:
WebSocket connection failed
WebSocket connection failed
Problem: Connection state shows ‘failed’Checklist:
- SDK Mode: Session token valid and not expired
- Network allows WebSocket connections
- No firewall blocking
Performance Issues
Low frame rate
Low frame rate
Problem: Avatar rendering is choppyCauses:
- WebGL fallback (WebGPU not supported)
- Insufficient device performance
- Too many browser tabs/processes
- Use Chrome/Edge for WebGPU support
- Check browser hardware acceleration:
- Chrome:
chrome://settings/system→ Enable hardware acceleration
- Chrome:
- Close unnecessary tabs
- Reduce container size if needed
High memory usage
High memory usage
Problem: Memory keeps growingCause: Resources not properly cleaned upSolution:
Slow initial loading
Slow initial loading
Problem: Avatar takes long to loadSolutions:
- Show loading progress to user:
- Preload avatars in background
- Avatar resources are cached after first load
Audio Format
What audio format is required?
What audio format is required?
Format Requirements:
Example: 1 second at 16kHz = 16000 × 2 bytes = 32000 bytesConverting from different sources:
| Property | Value |
|---|---|
| Format | PCM16 (16-bit signed integer) |
| Byte Order | Little-endian |
| Channels | Mono (1 channel) |
| Sample Rate | Match SDK config (default: 16000 Hz) |
How to configure sample rate?
How to configure sample rate?
Browser Compatibility
Supported browsers
Supported browsers
| Browser | Minimum Version | Notes |
|---|---|---|
| Chrome | 90+ | Best WebGPU support |
| Edge | 90+ | Best WebGPU support |
| Firefox | 90+ | WebGL only |
| Safari | 14+ | WebGL only, limited features |
Mobile browser support
Mobile browser support
| Platform | Browser | Notes |
|---|---|---|
| iOS | Safari 14+ | WebGL renderer |
| Android | Chrome (Android 8+) | WebGL renderer |
- Performance may vary by device
- Test on target devices
- Consider smaller container sizes
Safari issues
Safari issues
Common issues:
- Limited WebGPU support (falls back to WebGL)
- Some animations may differ
- Update to latest Safari
- Enable hardware acceleration
- SDK handles fallback automatically
Debugging
Enable detailed logging
Enable detailed logging
off- No logs (default)error- Errors onlywarning- Warnings + errorsall- All logs
Monitor state changes
Monitor state changes
Performance monitoring
Performance monitoring
Common Code Patterns
React component lifecycle (SDK Mode)
React component lifecycle (SDK Mode)
Vue 3 composable (SDK Mode)
Vue 3 composable (SDK Mode)
Error handling pattern
Error handling pattern

