fix(devtools): handle RPC registration regardless of module order#217
Closed
fix(devtools): handle RPC registration regardless of module order#217
Conversation
commit: |
Author
|
not required anymore due to nuxt/devtools#919 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
resolves #216, tested through the playground where it fixed the issue, but definitely open to feedback
❓ Type of change
📚 Description
This PR fixes a DevTools integration bug where the RPC namespace (
nuxt-a11y-rpc) was not registered if@nuxt/devtoolsinitialized 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/devtoolsappears earlier inmodules: []), the hook never fired and the RPC handlers were never registered.This resulted in DevTools errors such as:
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:
onDevToolsInitialized()(normal path)This ensures the DevTools RPC namespace is always registered, regardless of module order.
Why this matters
@nuxt/devtoolsinmodules: []