Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect HMR payload when using multiple environments with different root #17393

Closed
7 tasks done
lazarv opened this issue Jun 4, 2024 · 2 comments
Closed
7 tasks done

Comments

@lazarv
Copy link
Contributor

lazarv commented Jun 4, 2024

Describe the bug

I am using the new Environment API with multiple environments: client, ssr, rsc
I have different root configuration for the ssr and rsc environments
On file change, HMR payload is incorrect for the environments where the root is different than the main Vite config's root

Reproduction

https://stackblitz.com/edit/vitejs-vite-krepgb?file=server.js,folder-a%2Ffile-a.js&terminal=dev

Steps to reproduce

Start Vite dev server by running pnpm dev
Change the content of ./folder-a/file-a.js which is imported by ./folder-b/file-b.js which is imported by a ModuleRunner using the RSC environment's transport.
Check that HMR payload is incorrect, triggeredBy path is /home/projects/vitejs-vite-krepgb/folder-b/file-a.js, which doesn't exist, folder is incorrect.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vite: 6.0.0-alpha.18 => 6.0.0-alpha.18

Used Package Manager

pnpm

Logs

No response

Validations

Copy link

stackblitz bot commented Jun 4, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red
Copy link
Member

Following the discussion in #17394, I'm closing this issue as I guess it's not needed anymore. Feel free to make a new one if it's still needed.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants