-
Notifications
You must be signed in to change notification settings - Fork 452
Description
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/partytownintegration - 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
- Set up a project with Partytown (e.g., Astro with @astrojs/partytown integration)
- Configure Partytown to handle third-party scripts (Google Analytics, GTM, etc.)
- Deploy the project to production
- Run Google PageSpeed Insights audit or Lighthouse audit on the deployed site
- Open the "Best Practices" section of the audit report
- Observe warnings: "Uses deprecated APIs - SharedStorage, AttributionReporting"
- 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/partytownintegration 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
- Deprecated APIs in use (GTM) #178 - Similar deprecation warnings (resolved in past)
- Uses deprecated APIs - 1 Warning found #313 - Previous deprecation related issues
This appears to be a recurring issue where new Chrome deprecations affect Partytown's service worker implementation.