Development
This page explains how to debug and monitor your PWA during development.
Debug Toolbar Integration
The bundle integrates with Symfony's Web Debug Toolbar, providing a dedicated PWA panel for inspecting your Progressive Web App configuration.
What the Toolbar Shows
Manifest Tab:
Current manifest configuration
App metadata (name, icons, colors, display mode)
Installability status
Generated manifest JSON
Icon verification
Service Worker Tab:
Service worker status and registration
Caching strategies configured
Workbox configuration
Active cache names
Custom rules applied
Icons & Assets:
Generated icons (all sizes and formats)
Favicon status
Screenshot images
Startup images (iOS)

Installability Checker
The toolbar includes an installability checker that analyzes your PWA configuration:
✅ Green status: App meets installation requirements ⚠️ Yellow status: App partially meets requirements (may work on some platforms) ❌ Red status: Missing required configuration
Browser installation requirements change frequently. The bundle's installability indicator is a guide, but actual installation availability depends on the browser and platform.
Service Worker Debugging
Debugging service workers requires a different approach than regular JavaScript.
Development Mode Features
In development (APP_ENV=dev), the service worker includes:
Verbose Logging:
All Workbox operations logged to console
Cache hit/miss information
Route matching details
Background sync status
Inline Comments:
Explanation of each caching strategy
Route pattern documentation
Custom rule descriptions
Source Maps:
Easier debugging with readable code
Stack traces point to actual source
Browser DevTools
Chrome/Edge DevTools:
Open DevTools (F12)
Go to Application tab
Select Service Workers in the sidebar
From here you can:
See registration status
Unregister the service worker
Update on reload
Bypass for network
View cached resources in Cache Storage
Firefox DevTools:
Open DevTools (F12)
Go to Application tab (or about:debugging#/runtime/this-firefox)
View service workers and storage
Common Debugging Tasks
Force Service Worker Update:
// In browser console
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(reg => reg.update());
});Clear All Caches:
// In browser console
caches.keys().then(names => {
names.forEach(name => caches.delete(name));
});Check Current Service Worker:
// In browser console
navigator.serviceWorker.controllerProduction Mode
In production (APP_ENV=prod), the service worker is optimized:
All debugging code removed
Comments stripped out
Minified for smaller file size
Console logging disabled
This reduces file size and improves performance.
Logging Configuration
The bundle uses PSR-3 logging to record important events and errors.
Default Logger
By default, the bundle uses Symfony's default logger channel.
Custom Logger
Configure a custom logger for PWA-specific logging:
pwa:
logger: 'monolog.logger.pwa'Then define the logger in your Monolog configuration:
monolog:
channels: ['pwa']
handlers:
pwa:
type: stream
path: '%kernel.logs_dir%/pwa.log'
level: debug
channels: ['pwa']What Gets Logged
The bundle logs:
Manifest compilation events
Service worker generation
Icon processing
Asset compilation
Configuration errors
Runtime warnings
Logging Levels
DEBUG: Detailed processing information (development only)
INFO: Normal operational messages
WARNING: Non-critical issues (e.g., missing optional config)
ERROR: Critical problems that prevent PWA functionality
Development Tips
Testing Offline Mode
Method 1: Browser DevTools
Open DevTools → Network tab
Check "Offline" checkbox
Reload the page
Method 2: Throttling
Open DevTools → Network tab
Select "Slow 3G" or "Fast 3G"
Test performance with limited connectivity
Testing Installation
Desktop:
Open your app in Chrome/Edge
Look for install icon in address bar
Click to test installation flow
Mobile:
Visit your app on a real device or emulator
Look for "Add to Home Screen" prompt
Test the installed app experience
Cache Inspection
View cached resources:
DevTools → Application tab
Expand Cache Storage in sidebar
Click on cache names to see contents
Right-click resources to delete
Manifest Validation
Validate your manifest:
DevTools → Application tab
Click Manifest in sidebar
Review all properties
Check for warnings or errors
Testing Updates
Test how your PWA handles updates:
Make a change to your service worker config
Deploy the update
Reload the app
Check that service worker updates
Verify new version activates
Use skipWaiting: false in config to test manual update flows.
Common Development Issues
Manifest Not Loading
Symptoms: Manifest link appears in HTML but DevTools shows "No manifest detected"
Solutions:
Clear browser cache
Check manifest URL is accessible
Verify JSON syntax (use a JSON validator)
Ensure
{{ pwa() }}is in<head>section
Service Worker Not Updating
Symptoms: Changes to service worker don't appear
Solutions:
Hard refresh (Ctrl+Shift+R / Cmd+Shift+R)
Click "Update" in DevTools → Application → Service Workers
Check "Update on reload" in DevTools
Unregister and re-register the service worker
Install Prompt Not Showing
Symptoms: No install option appears
Check:
HTTPS is enabled (or using localhost)
Manifest has required properties
Service worker is registered
No console errors
User engagement criteria met (varies by browser)
Caching Issues
Symptoms: Old content still showing after updates
Solutions:
Update cache version in service worker config
Clear cache storage in DevTools
Implement cache expiration strategies
Use cache-first only for static assets
Best Practices for Development
Use HTTPS locally: Use
symfony servewith TLS or configure a local SSL certificateTest on real devices: Emulators don't perfectly match real device behavior
Monitor console: Watch for service worker errors and warnings
Clear cache regularly: Prevent stale data during development
Test offline scenarios: Ensure graceful degradation
Validate manifest: Use browser DevTools and online validators
Version your caches: Update cache names when content changes
Last updated
Was this helpful?