devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Fix e2e hang: rename Vite DevTools client-context global + bump for upstream auth-disable fix (vitejs/devtools#539)

Open antfubot opened this issue 3 months ago • 1 comments

Summary

The e2e suite hangs (15-min CI cap) since the Vite DevTools v0.5.0 / Devframe v0.9.2 migration (#1065). Root cause is two-layered; the blocking layer is an upstream @vitejs/devtools regression.

Layer 1 — renamed client-context global (in-repo, trivial)

The v0.5 migration renamed the host-page global window.__VITE_DEVTOOLS_CLIENT_CONTEXT__ → window.__DEVFRAME_HUB_CLIENT_CONTEXT__. Our e2e still waits on the old name, so ensureDockReady blocks 30s on a never-defined global and every DevTools-dependent test times out.

The new global has the same shape we rely on (.rpc, .rpc.isTrusted, .rpc.events, .docks.entries), so the fix is a mechanical rename across 4 files / 13 refs:

  • tests/e2e/fixtures/devtools.ts
  • tests/e2e/specs/devtools.spec.ts
  • tests/e2e/specs/data-inspector.spec.ts
  • tests/e2e/specs/code-server.spec.ts

Layer 2 — auth-disable no longer trusts the client (upstream, blocking)

Filed upstream: vitejs/devtools#539.

VITE_DEVTOOLS_DISABLE_CLIENT_AUTH=true (used by our e2e webServer) and clientAuth: false no longer mark the client RPC session trusted in @vitejs/[email protected]: createDevToolsContext registers the interactive-auth handler on the context RPC unconditionally, which pre-empts devframe's auth:false auto-trust shim. The client connects and gets docks, but isTrusted stays false, so the DevTools UI shows the auth prompt and never mounts. This blocks the e2e even after the Layer 1 rename.

Bump plan (do in order, once upstream ships)

  1. Blocked on vitejs/devtools#539. Track its fix/release.
  2. When released, bump the vite-devtools catalog ref in pnpm-workspace.yaml (currently ^0.5.0) to the fixed @vitejs/devtools / @vitejs/devtools-kit version; bump the devframe ref (^0.9.2) too if the fix lands in devframe. Refresh the lockfile.
  3. Apply the Layer 1 global rename (__VITE_DEVTOOLS_CLIENT_CONTEXT__ → __DEVFRAME_HUB_CLIENT_CONTEXT__) across the 4 test files above.
  4. Verify pnpm test:e2e:dev and pnpm test:e2e:built go green locally, then in CI.
  5. If upstream changes the trust/connection API shape, adjust ensureDockReady accordingly (the fixture also emits rpc:is-trusted:updated and reads docks.entries — re-verify both against the shipped version).

Interim

Until the upstream fix lands, e2e will keep hitting the 15-minute cap on every branch (it already does on main). Consider temporarily marking the e2e job non-required / allowed-to-fail so it stops masking other signal, and revert that once the bump is in.

Diagnosis provenance

Reproduced on a clean main checkout; instrumented @vitejs/devtools confirmed authDisabled is computed true yet the context RPC still runs the interactive-auth gate (requestTrust() → false, isTrusted stays false, client iframe never attaches). Full evidence in vitejs/devtools#539.

Investigation and issue authored with the help of an agent.

antfubot avatar Aug 20 '26 03:08 antfubot

🔗 Related PRs

nuxt/devtools#1065 - feat(deps): migrate to Vite DevTools v0.5.0 and Devframe v0.9.2 [merged] nuxt/devtools#1066 - perf(devtools): trim @nuxt/devtools runtime dependencies [merged]


📝 Issue Planner

Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

  • [ ] Create Plan

🧪 Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

💬 Have feedback or questions? Drop into our discord!

coderabbitai[bot] avatar Aug 20 '26 03:08 coderabbitai[bot]