Repeated navigation in an Inertia/Vue application causes the Vue Devtools Chrome extension (7.7.7) to become progressively slower.

Open
#1,193 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
devtools

Research direction

Start by locating initDevToolsServerListener() and tracing how it registers handlers on devtools.ctx.hooks through the birpc interface. Check how the broadcast instance behaves during teardown and reconnection before deciding whether an initialization guard is safe. Done means repeated initialization no longer adds duplicate handlers or causes redundant messages, while reconnection behavior remains correct.

Written by the indexing model from the issue text.

Description

fix: prevent duplicate DevTools server listener registration

##created with help of AI

Problem

Repeated navigation in an Inertia/Vue application causes the Vue Devtools Chrome extension (7.7.7) to become progressively slower.

Investigation revealed that initDevToolsServerListener() can be invoked repeatedly through the birpc interface. Each invocation registers additional handlers on devtools.ctx.hooks, without checking whether those handlers have already been registered.

After several navigations, the internal hook registry contained 45 distinct handlers for each of the following events:

  • routerInfoUpdated
  • sendInspectorTreeToClient
  • sendInspectorStateToClient

This caused thousands of redundant inspector and router messages, despite relatively few Vue component lifecycle events.

Fix

Make initDevToolsServerListener() idempotent using a module-scoped initialization guard.

Subsequent RPC calls no longer register duplicate listeners.

Verification
  • Reproduced with Vue 3.5.42 and Inertia 2.1.6.
  • Reproduced using a minimal Vue application without Pinia or Vue Router.
  • Confirmed repeated initDevToolsServerListener() RPC invocations using Chrome's debugger.
  • Confirmed accumulation of 45 distinct callbacks per internal messaging hook.
  • Verified that deduplicating listeners and preventing further registration resolves the performance degradation.
Considerations

The guard assumes that the underlying RPC broadcast instance remains valid across subsequent initialization requests.

Connection teardown and reconnection behavior should be verified before merging.

Dominant language
TypeScript
Stars
2.9k
Forks
292
Avg merge
3d 22h
Merged PRs (30d)
29

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vuejs/devtools

All issues in vuejs/devtools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.