evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.12k stars 194 forks source link

HMR support for Windows Subsystem for Linux Users #1340

Closed mcrascal closed 3 weeks ago

mcrascal commented 9 months ago

Feature Description

Vite's HMR does not seem to fire correctly out of the box for projects running in WSL where the editor application is running in Windows.

It seems like potentially a docs fix - recommend that users on WSL run their editor out of WSL, or detecting a WSL environment in our vite config, and toggling usePolling. Does not seem like something we'd want to turn on by default.

Using Vite on Windows Subsystem for Linux (WSL) 2 When running Vite on WSL2, file system watching does not work when a file is edited by Windows applications (non-WSL2 process). This is due to a WSL2 limitation. This also applies to running on Docker with a WSL2 backend.

To fix it, you could either:

Recommended: Use WSL2 applications to edit your files. It is also recommended to move the project folder outside of a Windows filesystem. Accessing Windows filesystem from WSL2 is slow. Removing that overhead will improve performance. Set { usePolling: true }. Note that usePolling leads to high CPU utilization.

Sinsstranger commented 8 months ago

It doesn't work

archiewood commented 3 weeks ago

Works fine now