If prod still doubles, something mounts that component twice or remounts it. Common ones:
- the tracker is in
layout.tsxand inpage.tsx - a
keyon a parent that changes after load (e.g.key={user?.id}going from undefined to an id) remounts the whole subtree - a redirect:
/dashboard→/dashboard?tab=overviewcounts as two views if your tracker listens to route changes too
Log console.count("dashboard mount") in the component and a console.trace() inside the effect, then look at the stack on the second call.