Uh oh!
There was an error while loading. Please reload this page.
feat(devtools): proxy client __connection.json to hub in standalone dev - #1070
Conversation
When running the DevTools client standalone (`pnpm dev` -> `nuxi dev client`), the SPA resolves the devframe connection meta relative to its current route, which the dogfooded Vite DevTools hub never serves. Proxy those lookups back to the hub so the standalone client can connect to a live RPC backend.
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAdded a Vite development-server proxy in the Nuxt DevTools client configuration. The proxy forwards relative Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to This is a localized development-only proxy change for standalone DevTools connectivity, with no actionable merge-blocking risk remaining beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Intent
When developing the DevTools client standalone via
pnpm dev(nuxi dev client), the client SPA at base/__nuxt_devtools__/client/couldn't connect to a live RPC backend.The app dogfoods the DevTools module on itself, so the Vite DevTools hub serves the devframe connection meta at its mount path
/__devtools/__connection.json. However, the client's RPC client resolves__connection.jsonrelative to its current route (e.g. after redirecting to/modules/overviewit fetches/__nuxt_devtools__/client/modules/__connection.json), which the hub never serves — so the standalone client's connection attempt 404s.This adds a dev-server-only Vite proxy that rewrites any
__connection.jsonlookup under the client base back to the hub's/__devtools/__connection.json, letting the standalone client connect to a live RPC backend.Scoped to local dev only:
server.proxyis a Vite dev-server feature and never applies to staticnuxi generateoutput. The proxy target honorsprocess.env.PORTto stay consistent with the existinghmr.clientPortlogic.This PR was created with the help of an agent.