Description
When starting a web call using @vapi-ai/web, Chrome logs a deprecation warning in the console:
This warning appears immediately when a call is initiated via vapi.start().
Environment
@vapi-ai/web version: 2.5.2
@daily-co/daily-js version: 0.85.0 (bundled dependency)
- Browser: Chrome (tested on latest stable)
- OS: macOS
Root Cause
The deprecation warning originates from the underlying Daily.co SDK (@daily-co/daily-js), which registers an unload event handler internally for WebRTC connection cleanup when users navigate away from the page.
Chrome has been deprecating the unload event since version 117 because:
- It's unreliable and doesn't always fire
- It prevents the back/forward cache (bfcache) from working properly
- It negatively impacts page performance
Reference: https://developer.chrome.com/docs/web-platform/deprecating-unload
Impact
- Current: The warning is informational and does not break functionality
- Future: Chrome is gradually phasing out
unload handlers. Eventually they will stop firing entirely unless explicitly opted-in via Permissions-Policy headers
Expected Behavior
No deprecation warnings should appear. The SDK should use modern alternatives like pagehide or visibilitychange events for cleanup operations.
Suggested Fix
This may require coordination with Daily.co to update @daily-co/daily-js to replace unload event handlers with pagehide event handlers, which:
- Are more reliable
- Don't block bfcache
- Are the recommended replacement per Chrome's deprecation guide
Steps to Reproduce
- Install
@vapi-ai/web v2.5.2
- Initialize Vapi with an API key
- Call
vapi.start(assistantId) to begin a web call
- Open Chrome DevTools Console
- Observe the deprecation warning
Additional Context
This issue may need to be reported upstream to Daily.co's daily-js repository as well, since the unload handler is registered within their SDK rather than directly in @vapi-ai/web.
Description
When starting a web call using
@vapi-ai/web, Chrome logs a deprecation warning in the console:This warning appears immediately when a call is initiated via
vapi.start().Environment
@vapi-ai/webversion: 2.5.2@daily-co/daily-jsversion: 0.85.0 (bundled dependency)Root Cause
The deprecation warning originates from the underlying Daily.co SDK (
@daily-co/daily-js), which registers anunloadevent handler internally for WebRTC connection cleanup when users navigate away from the page.Chrome has been deprecating the
unloadevent since version 117 because:Reference: https://developer.chrome.com/docs/web-platform/deprecating-unload
Impact
unloadhandlers. Eventually they will stop firing entirely unless explicitly opted-in via Permissions-Policy headersExpected Behavior
No deprecation warnings should appear. The SDK should use modern alternatives like
pagehideorvisibilitychangeevents for cleanup operations.Suggested Fix
This may require coordination with Daily.co to update
@daily-co/daily-jsto replaceunloadevent handlers withpagehideevent handlers, which:Steps to Reproduce
@vapi-ai/webv2.5.2vapi.start(assistantId)to begin a web callAdditional Context
This issue may need to be reported upstream to Daily.co's
daily-jsrepository as well, since theunloadhandler is registered within their SDK rather than directly in@vapi-ai/web.