Description
As some already may noticed, live reloading for the NixOS homepage broke when using the development environment provided by our nix flake. After some debugging, I figured out what causes this degradation. It seems to be caused by the presence of symlinks provided by the nix flake.
To make this bug reproducible, I set up the reproduce-symlink-bug
branch that provides an environment to easily reproduce the bug.
git clone --branch reproduce-symlink-bug https://github.com/NixOS/nixos-homepage.git
After cloning, entering the flake with the inputsFrom = [ config.pre-commit.devShell ];
line commented out will result in an environment where live reload works perfectly. After uncommenting, the presence of the then generated .pre-commit-config.yaml
symlink now breaks live reloading. Commenting out and deleting the symlink again returns the environment to its normal function.
This seems to be an Astro related bug, since I cannot reproduce it with either a blank Vite project nor with a blank script using chokidar, the file watching library used by Vite.