Skip to content

[Vite 3] @vitejs/plugin-vue breaks HMR when used with vite-plugin-ssr #9341

@brillout

Description

@brillout

Describe the bug

HMR doesn't work.

== EDIT ==
The root cause seems to be that @vitejs/plugin-vue is not respecting ecosystem query parameters. See discussion below.
=========

I had a quick look at it: the signal is not being sent to the browser.

Note that the socket message {"type":"update","updates":[{"type":"js-update","timestamp":1658677022754,"path":"/pages/index.page.client.vue?extractExportNames&lang.vue" is not enough (it only updates the ?extractExportNames version of the module).

The terminal says:

5:38:42 PM [vite] hmr update /pages/index.page.client.vue?extractExportNames&lang.vue

But that's not correct as it should say:

5:38:42 PM [vite] hmr update /pages/index.page.client.vue?extractExportNames&lang.vue
5:38:42 PM [vite] hmr update /pages/index.page.client.vue

The last line is missing.

Reproduction

https://github.com/brillout/vps-issue-client-only-hmr

System Info

System:
    OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (2) x64 Intel(R) Celeron(R) N4020 CPU @ 1.10GHz
    Memory: 224.54 MB / 2.71 GB
    Container: Yes
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 18.0.0 - ~/.config/nvm/versions/node/v18.0.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.6.0 - ~/.config/nvm/versions/node/v18.0.0/bin/npm
  Browsers:
    Firefox: 97.0.1
  npmPackages:
    @vitejs/plugin-vue: ^3.0.1 => 3.0.1 
    vite: ^3.0.2 => 3.0.2

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions