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

File changes not detected when developing in WSL2 / Dev-Containers (Docker desktop with WSL backend)

Open anton-kirschhock opened this issue 2 years ago • 1 comments

Summary

When using WSL2 / Dev-Containers (Docker desktop with WSL backend) as a development environment filechanges are not being detected.

I've tried Changing the vm.max_map_count, fs.inotify.max_user_watches and added a .env file with (various combinations):

CHOKIDAR_USEPOLLING=true
FAST_REFRESH=false

From what I understand, due to the architecture of WSL, Filewatching (non-polling) does not work. But using polling could be a work-arround to continue using WSL. For example in Angular CLI (which uses Webpack), there is the option to use Polling for detecting filechanges. (ng serve --poll=2000).

Do you guys have any idea how to force Polling by your CLI tooling?

Environment

expo-env-info 1.0.3 environment info: System: OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye) Shell: 5.1.4 - /bin/bash Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.18 - /usr/bin/yarn npm: 8.5.0 - /usr/local/bin/npm npmPackages: expo: ~44.0.0 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: ^0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

/

Error output

/

Reproducible demo or steps to reproduce from a blank project

it is reproducible in a blank expo project, in WSL2 or in a Dev-container.

anton-kirschhock avatar May 29 '22 13:05 anton-kirschhock

Running into the same issue. Node version 18.4.0

synthlace avatar Jul 02 '22 03:07 synthlace

Hi all! Since this relates to functionality in Metro (the bundler), I think we have to file an issue there. There is not a lot we can do from Expo's side when Metro is lacking functionality, such as polling.

Closing this issue here, but feel free to reopen this on the Metro github!

byCedric avatar Jan 05 '24 13:01 byCedric