Skip to content

fix: enqueue the Vite client with no version - #366

Merged
ogorzalka merged 1 commit into
developfrom
fix/vite-client-version
Sep 30, 2026
Merged

ogorzalka merged 1 commit into
developfrom
fix/vite-client-version

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Regression from #357 (v13.34.0-beta), found while testing a stale hot file: the dev server's client was enqueued as @vite/client?ver=7.1.2 (wp_enqueue_script_module()'s version defaults to WordPress's). The modules Vite serves import /@vite/client by its bare URL, and a module is identified by its URL — so the browser loaded the client twice, with two HMR connections. The entries were already enqueued with a null version; the client now is too. The existing test asserts the version; it fails on the previous code.

The modules Vite serves import /@vite/client by its bare URL; enqueued with
WordPress's version appended, the client loaded twice, as two modules with
two HMR connections. Regression from v13.34.0-beta.
@ogorzalka
ogorzalka merged commit b113719 into develop Sep 30, 2026
11 checks passed
@ogorzalka
ogorzalka deleted the fix/vite-client-version branch September 30, 2026 08:45
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.

1 participant