Skip to content

Bug: File watcher / live reload not working when a flake.nix created symlink is present #1641

Open
@thilobillerbeck

Description

@thilobillerbeck

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions