Skip to content

Lighthouse warnings for deprecated APIs (SharedStorage & AttributionReporting) - Astro users impacted #694

@kaktaknet

Description

@kaktaknet

Describe the bug

Issue

Google Lighthouse and PageSpeed Insights are reporting deprecation warnings when analyzing sites that use Partytown's service worker. Specifically, the warnings indicate that deprecated Chrome APIs are being used:

  • SharedStorage API - marked as deprecated
  • AttributionReporting API - marked as deprecated

These warnings appear in the "Best Practices" section of Lighthouse reports under "Uses deprecated APIs" with the following message:

Deprecated APIs will eventually be removed from the browser. Learn more about deprecated APIs

Impact

This is particularly affecting:

  • Astro framework users with the @astrojs/partytown integration
  • Any web frameworks or projects using Partytown
  • Projects that rely on Google PageSpeed Insights audit scores

The warnings negatively impact:

  • Lighthouse Best Practices score
  • Console warnings in Chrome DevTools
  • Potential future compatibility issues when these APIs are actually removed from browsers

Root Cause

The deprecation warnings appear to originate from inside Partytown's service worker implementation at /~partytown/partytown-sandbox-sw.html. The service worker appears to reference or emulate access to these deprecated Chrome APIs.

Solution Needed

Update Partytown's service worker implementation to avoid using or referencing SharedStorage and AttributionReporting APIs, or suppress these warnings in a way that doesn't impact the actual functionality.

Related: This issue affects downstream projects like Astro that depend on Partytown.

Reproduction

#693 To reproduce: 1. Create any project using Partytown 2. Add Partytown configuration to your site 3. Deploy to production 4. Run Google PageSpeed Insights or Lighthouse audit 5. Check the "Best Practices" section for "Uses deprecated APIs" warning

Steps to reproduce

  1. Set up a project with Partytown (e.g., Astro with @astrojs/partytown integration)
  2. Configure Partytown to handle third-party scripts (Google Analytics, GTM, etc.)
  3. Deploy the project to production
  4. Run Google PageSpeed Insights audit or Lighthouse audit on the deployed site
  5. Open the "Best Practices" section of the audit report
  6. Observe warnings: "Uses deprecated APIs - SharedStorage, AttributionReporting"
  7. Check Chrome DevTools console for deprecation warnings

Browser Info

Chrome (latest) Edge (latest) Any Chromium-based browser Note: Lighthouse warnings are Chrome/Chromium-specific as the deprecated APIs are Chrome-specific.

Additional Information

Context

This issue impacts not only Partytown directly, but also downstream projects that depend on it:

  • Astro Framework: The @astrojs/partytown integration is widely used in Astro projects
  • Next.js: Partytown users integrating it with Next.js
  • Qwik Framework: Native Partytown integration
  • Any SPA framework using Partytown for third-party script isolation

Google Chrome Platform Status

The SharedStorage and AttributionReporting APIs are being deprecated by Chrome as part of their Privacy Sandbox initiative. The warnings will become more prominent as these APIs reach end-of-life.

Previous Related Issues

This appears to be a recurring issue where new Chrome deprecations affect Partytown's service worker implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions