You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Panel resets (back to Components, tree collapsed) and re-injects user-app.js on every same-document history.replaceState #1189
While scrolling an Inertia 2 page, the DevTools panel resets itself: it switches from whatever tab is open (e.g. Timeline) back to Components, and the component tree collapses to Root > Inertia > EditPage. The Network tab shows chrome-extension://nhdogjmejiglipccpnnnanhbledajbpd/dist/user-app.js (~1 MB) requested again each time. The page itself does not reload (a window variable set before scrolling survives).
Cause (as far as I can tell)
Inertia 2 saves the document scroll position in history state: a debounced (100 ms) window scroll listener calls history.saveDocumentScrollPosition(), which ends in history.replaceState(). The URL does not change.
The panel (dist/devtools-panel.js) re-injects the backend on chrome.devtools.network.onNavigated:
So every pause in scrolling counts as a navigation and restarts DevTools. With Inertia 1.x (which only saved scroll-region elements, not the window scroll) this did not happen.
Reproduction
Any Inertia 2 app (Vue 3) with a page taller than the viewport.
Open DevTools → Vue panel, expand a few levels of the component tree, or switch to Timeline.
Scroll the page and stop (fast flick to the top/bottom, or drag the scrollbar).
The panel jumps back to Components with the tree collapsed; Network shows a new user-app.js request.
Minimal check without Inertia: in the Console of any Vue 3 page, run history.replaceState(history.state, '') with the Vue panel open.
Expected
A same-document history update (replaceState / pushState with no document load) should not reset the panel or re-inject the backend. Only a real document navigation should.
Possible fix
In the onNavigated handler, check whether the backend is still alive (e.g. the existing heartbeat, or window.__VUE_DEVTOOLS_GLOBAL_HOOK__ / a backend flag via inspectedWindow.eval) before resetting and re-injecting.
Activity