Skip to content

Chrome deprecation warning: UnloadHandler from Daily.co SDK #150

@fermellone

Description

@fermellone

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:

  1. It's unreliable and doesn't always fire
  2. It prevents the back/forward cache (bfcache) from working properly
  3. 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

  1. Install @vapi-ai/web v2.5.2
  2. Initialize Vapi with an API key
  3. Call vapi.start(assistantId) to begin a web call
  4. Open Chrome DevTools Console
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions