fastify-cli icon indicating copy to clipboard operation
fastify-cli copied to clipboard

watch mode not working with git worktree

Open monkoninja opened this issue 3 years ago • 4 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.0.0

Plugin version

No response

Node.js version

16.17.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

20.04

Description

At #547, I mistakenly assumed that watch mode was not working because of esm, in fact, watch mode is not working if the project is in the git worktree.
If you use typescript, then typescript rebuilds the project, but the server still does not restart.

Steps to Reproduce

git clone https://github.com/railwayapp-templates/fastify --bare
cd fastify.git
git worktree add main
cd main
npm i
npm run dev

change any file -> typescript rebuild -> server does not restart

Expected Behavior

No response

monkoninja avatar Sep 07 '22 12:09 monkoninja

What's special with worktree that breaks this? We just use normal OS file watching.

mcollina avatar Sep 07 '22 20:09 mcollina

I'm not sure what the problem is, so far I'm using nodemon. It works with worktree.

monkoninja avatar Sep 09 '22 13:09 monkoninja

I couldn't reproduce this on my end, I followed the steps you listed.

My environment:

  • OS → Windows 10 (21H1)
  • Node Version → 16.17.0
  • Fastify-CLI Version → 5.4.2

nooreldeensalah avatar Sep 19 '22 16:09 nooreldeensalah

I think the source of the issue starts from here: https://github.com/nodejs/node/issues/36005

and leads to the chokidar module's funding

If we drop that module, we should go for the node:fs.watch one

Eomm avatar Sep 24 '22 15:09 Eomm