Prompt
How do I use session replay to reproduce a frontend bug?
Latest observation
Session replay is most useful when you want to see what the user did right before the bug happened and then reproduce the same path locally.
A practical workflow
1. Find the right replay
Look for a session where the bug occurred and note:
- the exact time
- the page/route
- the user actions leading up to it
- any console errors, network failures, or rage clicks
- the browser/device info
If your replay tool links to logs, capture:
- request payloads
- response codes
- JavaScript errors
- feature flags / experiment variants
2. Reconstruct the environment
Try to match the conditions from the replay:
- browser version
- viewport size
- device type
- logged-in vs logged-out state
- locale/timezone
- user permissions
- feature flags/A-B test variant
A bug can depend on one of these, so don’t skip them.
3. Replay the user path manually
Use the replay as a script:
- open the same page
- perform the same clicks, typing, scrolling, and navigation
- use the same data if possible
- follow the same timing if the issue looks race-condition related
If the issue is tied to timing, try:
- slower interactions
- faster interactions
- repeated actions
- back/forward navigation
- refreshing at key steps
4. Inspect the exact failing state
When the bug appears, compare the DOM/state to the replay:
- was an API response different?
- did the UI render unexpected content?
- did an element exist but was hidden/disabled?
- did a state update happen late or not at all?
Useful things to compare:
- DOM snapshot
- network waterfall
- console output
- application state/store values
- CSS/layout at the moment of failure
5. Turn the replay into a test
Once you can reproduce it:
- write a unit test for the logic bug
- write an integration test for the component flow
- write an E2E test for the full user journey
- add regression coverage for the edge case
This is the best way to make sure the bug doesn’t come back.
Tips that help a lot
- Correlate replay with logs using a session ID or request ID.
- Replay only the key segment instead of the whole session.
- Check for nondeterminism: feature flags, race conditions, and external data often change the outcome.
- Look for DOM mutations that don’t match the replayed user action.
- Use source maps so stack traces line up with your code.
- If the replay tool supports it, jump to the moment of the error and inspect the surrounding events.
Common patterns session replay exposes
- click handlers not firing because an overlay blocks the element
- form state resetting after navigation
- race conditions between API calls
- stale props/state in React/Vue/etc.
- layout issues on a specific screen size
- missing or malformed backend data
- third-party script interference
Important limitations
Session replay helps you observe the bug, but not always perfectly reproduce it:
- network timing may differ locally
- production data may be unavailable
- some issues depend on real user data or device behavior
- privacy tools may mask inputs, limiting exact reproduction
If you want, I can also give you a step-by-step debugging checklist for a specific replay tool like LogRocket, FullStory, Sentry Replay, Datadog RUM, or OpenReplay.