Skip to content

fix(deps): pin vite to 8.0.x (< 8.1) to unbreak DevTools e2e - #1020

Merged
antfu merged 1 commit into
mainfrom
fix/pin-vite-8.0-e2e
Jul 14, 2026
Merged

fix(deps): pin vite to 8.0.x (< 8.1) to unbreak DevTools e2e#1020
antfu merged 1 commit into
mainfrom
fix/pin-vite-8.0-e2e

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Problem

main e2e is red: Vite is currently pinned to ^8.1.4 in the overrides block of pnpm-workspace.yaml.

Vite 8.1 changed WebSocket-upgrade handling, and @vitejs/devtools@0.4's route-bound RPC socket (crossws, attached to Vite's HTTP server) ends up calling server.handleUpgrade() twice on the same socket under SSR:

Error: server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration

That kills the DevTools socket, so __VITE_DEVTOOLS_CLIENT_CONTEXT__ never initializes and the client injection never lands — every SSR playground e2e times out (empty / tab-pinia / tab-seo), while the ssr: false spa playground dodges the second environment's upgrade handler and stays green.

(A prior fix for this landed in #1012, but it went stale/conflicting after #1015 rewrote the overrides block to use literal ranges instead of catalog: refs. This PR reapplies the same fix rebased onto current main.)

Fix

@vitejs/devtools has no Vite 8.1-compatible release yet (still 0.4.0, peer vite: *), so pin the vite override to ~8.0.14 (resolves 8.0.16). Unpin once @vitejs/devtools ships Vite 8.1 support.

Verification

  • pnpm test:e2e:dev: 44 passed / 12 skipped, 0 failures
  • pnpm test:e2e:built: 3 passed / 53 skipped, 0 failures
  • pnpm lint, pnpm build, pnpm typecheck, pnpm test:unit all pass

This PR was created with the help of an agent.

Vite 8.1 changed WebSocket-upgrade handling, and @vitejs/devtools@0.4's route-bound RPC socket (crossws, attached to Vite's HTTP server) ends up calling server.handleUpgrade() twice on the same socket under SSR, killing the DevTools socket so __VITE_DEVTOOLS_CLIENT_CONTEXT__ never initializes and the client injection never lands. That turns every SSR playground e2e red (empty / tab-pinia / tab-seo), while the ssr:false spa playground dodges the second environment's handler and stays green.

@vitejs/devtools has no Vite 8.1-compatible release yet (still 0.4.0, peer vite: *), so pin the vite override to ~8.0.14 (resolves 8.0.16). Unpin once @vitejs/devtools ships Vite 8.1 support.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvite@​8.0.16991008298100

View full report

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: fad5212
Status: ✅  Deploy successful!
Preview URL: https://90875509.nuxt-devtools.pages.dev
Branch Preview URL: https://fix-pin-vite-8-0-e2e.nuxt-devtools.pages.dev

View logs

@antfu
antfu merged commit b9b6fa7 into main Jul 14, 2026
7 checks passed
@antfu
antfu deleted the fix/pin-vite-8.0-e2e branch July 14, 2026 09:23
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.

2 participants