Panel resets (back to Components, tree collapsed) and re-injects user-app.js on every same-document `history.replaceState`

Abierto
#1,189 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with the chrome.devtools.network.onNavigated handler in dist/devtools-panel.js and trace how it resets the panel and injects dist/user-app.js. Reproduce the behavior with history.replaceState(history.state, '') while the Vue panel is open, then inspect the existing heartbeat or backend state mentioned in the issue. Done means same-document history updates preserve the panel state and avoid reinjection, while real document navigation still initializes the backend.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment
  • Vue DevTools Chrome extension 7.7.7 (latest on the Chrome Web Store)
  • Chrome 157.0.8103.39, macOS 27.2
  • Vue 3.5.28, @inertiajs/vue3 / @inertiajs/core 2.3.18, Quasar 2.18.6
What happens

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:
    chrome.devtools.network.onNavigated.addListener(() => {
      // reset + inject dist/user-app.js again
    })
    
  • 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
  1. Any Inertia 2 app (Vue 3) with a page taller than the viewport.
  2. Open DevTools → Vue panel, expand a few levels of the component tree, or switch to Timeline.
  3. Scroll the page and stop (fast flick to the top/bottom, or drag the scrollbar).
  4. 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.

Lenguaje dominante
TypeScript
Estrellas
2.9k
Forks
292
Merge medio
3 d 22 h
PR fusionados (30 d)
29

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vuejs/devtools

Todos los issues de vuejs/devtools

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.