Playwright error Error: locator.click: Element is not attached to the DOM
The element you were about to click got unmounted and remounted between when it was found and when the action fired.
Why this happens
- The framework (React/Vue/etc.) re-rendered and replaced the element between resolution and action, a classic stale-handle problem
How to fix it
- Prefer Locators (`page.locator(...)`) over a cached `ElementHandle`, since Locators re-resolve the DOM on every action automatically
- If you're calling `page.$()` anywhere, switch that call to the Locator API