clojurescriptcidershadow-cljs

Emacs Cider with Shadow-cljs browser settings on Windows wsl2 hot code reload


I would like to get hotcode reload to work on Windows wsl2 in emacs/cider using shadow-cljs (it doesn't work with shell shadow-cljs watch command in the terminal as well).

I should say oddly 1 in every couple of tries using it it will actually run as it normal would in most which is very nice just isn't consistent for productivity if it doesn't work most the time.

The usual status is the repl will sit on the initial compile. On the browser shadow-cljs dashboard at port 9630 it says "Unknown, waiting for recompile" yet when a file is updated it never updates.


Solution

  • In WSL2 file watching only works when used on the actual Linux filesystem. It does not work when working in the /mnt/c/... directories. WSL2 actually works much better when working in /home/....

    There are a couple open issues on https://github.com/microsoft/WSL (eg. #4739) about this. It is not specific to shadow-cljs and affects many other file watchers.

    For now if you want to work with the Windows files you should stick to WSL1 as it will be much faster. WSL2 is only faster when using the Linux filesystem but that makes working with those files from Windows a bit slower. WSL1 is still the better option when you want to work with the files from Windows IMHO.