Scenario
You’re debugging a React TodoMVC app athttps://demo.playwright.dev/todomvc that exhibits the following problems:
- Console warnings appear when adding todos
- Network requests fail intermittently
- The app doesn’t update after certain actions
Workflow
Start session with network and console collection
Launch bdg and navigate to the app. Both network and console collectors are enabled by default.Wait for the session to start. You’ll see confirmation that Chrome is running.
Monitor initial page load
Check what resources loaded and if there are any early console messages.Expected output:If you see React warnings about deprecated APIs or missing keys, note them for later.
Interact with the app and watch for issues
Add a todo item using form interaction commands.Expected output:
Check for console errors after interaction
After adding the todo, check if new console messages appeared.Expected output:The warning indicates React is re-rendering without proper keys. This could cause state issues.
Monitor network activity during state changes
Check if the app made API calls when you added the todo.Expected output:If you see 4xx or 5xx errors, investigate headers and response bodies.
Inspect failed requests in detail
If you found failing network requests, get full details including headers and response body.Expected output:
Test edge cases systematically
Reproduce the issue by testing edge cases like empty inputs, special characters, and rapid actions.
Analysis Tips
Correlate console errors with network timing
Export both console and network data, then cross-reference timestamps:Find React warnings about missing keys
Identify XHR failures
Common SPA Issues
Console: React key prop warnings
Console: React key prop warnings
Symptom:
Warning: Each child in a list should have a unique "key" prop.Diagnosis: List items are re-rendering inefficiently, which can cause state loss.Investigation:Network: CORS errors on API calls
Network: CORS errors on API calls
Symptom: Fetch requests fail with CORS errors in console.Diagnosis: Missing
Access-Control-Allow-Origin headers.Investigation:Performance: State updates causing full re-renders
Performance: State updates causing full re-renders
Symptom: UI freezes when adding items.Diagnosis: Inefficient state updates triggering excessive DOM operations.Investigation:
Variations
Debug with screenshots for visual confirmation
Capture the UI state before and after actions:Stream console messages in real-time
Watch console output as you interact with the app:Export everything for offline analysis
Next Steps
Console Command
Learn about console filtering and message expansion
Network Monitoring
Deep dive into network inspection and HAR export
Form Interaction
Master form filling and keyboard events
Testing Forms
Systematic form validation testing

