servor: Doesn't detect change in nested files (on Linux)

Hey, Luke 👋🏻

So I was trying snowpack out, and the docs brought me here. Their doc highly recommends servor. 😉 I’ve watched you in YT on pushing the web forward on a bundle-less future. I’m excited that it’s becoming more mainstream.

So I’m using this in Ubuntu via WSL / Windows 10; while it reloads fine when I change the index.html, it doesn’t reload if I change the JS file.

Here’s a screencast I made to document the error.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@nakleiderer I actually agree with you on size being less important, since this is a dev dependency.

If the file size is the problem, then I would argue that this is a dev dependency and file size is not that going to a big deal especially it’s only 2.6kb

But the author seems he wanted this to be fixed at the main library level without dependency. Let’s wait. The main thing here is we can’t rely on Node’s Native fs.watch. It’s a buggy implementation. 🙊 That’s the whole reason, chokidar, node-watch, cheap-watch, and other permutations exist.

@thisguychris Fair points all around. I’ve mainly used chokidar in environments where dependency size is largely irrelevant, so I wasn’t familiar with the size. Thanks for the insight!

Is it a goal of this project to be light-weight on dependencies? I see that mentioned as a feature in the docs, but I’m curious if that is intended to be a defining trait of this project or a reflection of its current state. Is it a goal of this project to be used in deployed environments or as a development tool? If it’s a development tool, then dependency weight is less important in this project than it is for Sapper, which is run in deployed environments. I agree that chokidar’s size is disproportionate to the current size of this project, though it appears to be a more mature project than some of the alternatives with a large following. Popularity isn’t everything though.

Obviously, I’m happy with any solution to the problem. I think a clarification on the principles/goals of this project can help the community contribute more effectively. Again, thanks for the reply 😃

@nakleiderer chokidar has issues on its own too.

It was even dropped by Sapper (Svelte’s NextJS) 2 years ago and is now using cheap-watch.

And I think the author wanted something internal? Maybe because of filesize? Chokidar is huge compared to the alternatives I have suggested. 21.8kb (chokidar) vs 2.6kb (node watch) or 970b (cheap-watch).

Also, servor itself is lean, around 9.7kb. I don’t think putting a dependency which is twice the size of the main project makes sense.

I believe I’m also running into this issue. I believe using chokidar instead of node-watch will smooth over duplicate events and operating system differences.

Ok great! Now, I would like to try resolve that console error for you too… I’m wondering if it has something to do with your finding here:

I tried to console.log inside the loop of fs.watch, I get 9 “changed” logs when I edit one file.

I’m going to look at how node-watch smooth that signal out. We know its doing too much work and thats never good. Hopefully a debounce or something fixes the issue.