-
Notifications
You must be signed in to change notification settings - Fork 115
Hot reloading does not work for subdirectories in Linux #207
Comments
For what it's worth, For example, |
I want to add that it's not Typescript specific. Anyone who uses Babel as well won't be able to use the hot reload.
To this:
And the hot reload indeed works again(no reloading logging, but the function gets updated) |
I'm developing an app with Angular 6, it's a bit hacky but straight up editing the |
I added a PR here which uses |
* Prettier * Fix(worker): Use chokidar for file watching fixes#207 * fix(worker): Re-added missing debug conditional
Thanks a lot for landing this ❤️ |
Environment details
Steps to reproduce
After taking a look at the code, it seems from this line that
fs.watch
is used for hotloading. This has a known limitation thatrecursive: true
does not work on Linux (see https://nodejs.org/api/fs.html#fs_caveats). In order to work around it, what do you think about checkingpackage.json
for themain
field, which indicates the file that contains the functions, and then also watching the directory that file is in? But this would still lead to problems if the main file for functions calls helper functions in other subdirectories, so it doesn't solve the issue completely. Alternatively, the emulator can crawl the entire directory first so it knows all the subdirectories to watch, but that is a lot of work. So perhaps it's worth just printing out a warning messaging when Linux is detected.The text was updated successfully, but these errors were encountered: