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

[Bug]: HMR doesn't trigger recompile in Docker on WSL2 #3193

Closed
jan-bures opened this issue Aug 12, 2024 · 1 comment
Closed

[Bug]: HMR doesn't trigger recompile in Docker on WSL2 #3193

jan-bures opened this issue Aug 12, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@jan-bures
Copy link

jan-bures commented Aug 12, 2024

Version

System:
  OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13600KF
  Memory: 12.61 GB / 15.54 GB
  Container: Yes
  Shell: 5.2.15 - /bin/bash
npmPackages:
  @rsbuild/core: 1.0.1-beta.11 => 1.0.1-beta.11 
  @rsbuild/plugin-svelte: 1.0.1-beta.11 => 1.0.1-beta.11

Details

When running Docker Desktop (with the WSL2 engine) on Windows 11, the dev server doesn't recompile files when HMR is triggered by saving changes, even though the websocket is connected and the page reloads.

The testing project where this occurs was created using npx create rsbuild@latest with the Svelte template.

In rsbuild.config.mjs, I am using usePolling: true in dev.watchFiles.options, similarly to my previous Vite setup, since without it, WSL doesn't register changes made from a Windows application.

Reproduce link

https://github.com/jan-bures/rsbuild-test-project

Reproduce Steps

  1. Execute docker compose up -d in the folder of the example project.
  2. Open http://localhost:3000 in a browser.
  3. Modify src/App.svelte and save the changes.
  4. The page in the browser gets refreshed but the changed files don't get recompiled.
@jan-bures jan-bures added the 🐞 bug Something isn't working label Aug 12, 2024
@chenjiahan
Copy link
Member

If the dev server doesn't recompile files after saving changes, it should be related to Rspack's watcher (watchpack)

Have you seen any logs like this: webpack/watchpack#187?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants