Skip to content

Conversation

@nicokempe
Copy link

πŸ”— Linked issue

resolves #216, tested through the playground where it fixed the issue, but definitely open to feedback

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR fixes a DevTools integration bug where the RPC namespace (nuxt-a11y-rpc) was not registered if @nuxt/devtools initialized before @nuxt/a11y.

Root cause

The DevTools RPC handlers were registered only inside onDevToolsInitialized().
If DevTools had already finished initialization before this module executed (which happens when @nuxt/devtools appears earlier in modules: []), the hook never fired and the RPC handlers were never registered.

This resulted in DevTools errors such as:

[nuxt-devtools] RPC error on executing "nuxt-a11y-rpc:connected"
[birpc] function "nuxt-a11y-rpc:connected" not found

The a11y runtime itself continued to work correctly, but the DevTools panel was partially broken.

Solution

The RPC registration logic is now resilient to initialization order by:

  • Registering RPC handlers via onDevToolsInitialized() (normal path)
  • Performing a best-effort immediate registration attempt to handle cases where DevTools was already initialized
  • Guarding against duplicate registration

This ensures the DevTools RPC namespace is always registered, regardless of module order.

Why this matters

  • Fixes broken DevTools integration in existing / legacy projects that explicitly include @nuxt/devtools in modules: []
  • Fully backward-compatible and non-breaking

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/a11y/@nuxt/a11y@217

commit: 7ba6938

@nicokempe
Copy link
Author

not required anymore due to nuxt/devtools#919

@nicokempe nicokempe closed this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevTools RPC not registered when @nuxt/a11y loads after @nuxt/devtools

1 participant