Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn watch doesn't get changes from all files on Linux and Windows #989

Closed
molant opened this issue Feb 18, 2020 · 1 comment · Fixed by #991
Closed

yarn watch doesn't get changes from all files on Linux and Windows #989

molant opened this issue Feb 18, 2020 · 1 comment · Fixed by #991

Comments

@molant
Copy link
Contributor

molant commented Feb 18, 2020

Environment

Linux:

System:
    OS: Linux 4.19 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 10.65 GB / 12.17 GB
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 12.16.0 - ~/.nvm/versions/node/v12.16.0/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.0/bin/npm

Windows:

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 5.42 GB / 15.60 GB
  Binaries:
    Node: 12.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD

Description

Trying to work on the CLI project. Running yarn watch doesn't detect changes in all files.
The ones under packages/cli/src are detected, but if I change something in a file nested more deeply it doesn't work (e.g.: packages/cli/src/commands/doctor/info.ts).

Reproducible Demo

I've attached a gif of the issue. It's a bit blurry but hopefully you can see what's going on:

watch-issue

  1. Change to packages/cli/src/bin.ts gets detected
  2. Change to packages/cli/commands/doctor/info.ts goes unnoticed

This happens in Linux and Windows just after cloning and doing yarn with node 12 and 13. It looks like the code to watch should work (recursive: true). Don't know if it is a node limitation in these platforms (ie.: limit on ionodes on Linux) or if it happens on macOS as well.
Happy to work on this although I might have to pull an extra package to make it work cross platform.

@molant
Copy link
Contributor Author

molant commented Feb 19, 2020

I've done a bit more of research and this looks like a platform limitation.
This recent PR in node will change the behavior of { recursive: true } and throw an exception if it is not supported in the platform. I'll work on a cross-platform fix for this.

molant added a commit to molant/cli that referenced this issue Feb 19, 2020
Use `chokidar` to track file system changes as soon it will throw an
error if the platform does not support `{ recursive: true }`.

Fix also an error where the built file was not being deleted when the
source was removed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix react-native-community#989
Ref: nodejs/node#29947
molant added a commit to molant/cli that referenced this issue Feb 19, 2020
Use `chokidar` to track file system changes as soon it will throw an
error if the platform does not support `{ recursive: true }`.

Fix also an error where the built file was not being deleted when the
source was removed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix react-native-community#989
Ref: nodejs/node#29947
thymikee pushed a commit that referenced this issue Feb 20, 2020
Use `chokidar` to track file system changes as soon it will throw an
error if the platform does not support `{ recursive: true }`.

Fix also an error where the built file was not being deleted when the
source was removed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #989
Ref: nodejs/node#29947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant