Commit 50cb5a6
authored
Ignore the
## Description
This prevents Metro from crashing with an `Invariant Violation` when
internal scripts dynamically recreate this directory or replace it with
a symlink during the `expo prebuild` process in example apps.
```
<>gesture-handler/apps/expo-example/node_modules/@expo/cli/build/src/utils/errors.js:130
throw error;
^
Invariant Violation: Detected addition or modification of file node_modules/react-native-screens/.rnrepo-cache/Current, but it is tracked as a non-empty directory
at invariant (<>gesture-handler/apps/expo-example/node_modules/invariant/invariant.js:40:15)
at TreeFS.addOrModify (<>gesture-handler/apps/expo-example/node_modules/@expo/metro-file-map/build/lib/TreeFS.js:386:41)
at Timeout.emitChange [as _onTimeout] (<>gesture-handler/apps/expo-example/node_modules/@expo/metro-file-map/build/index.js:580:32)
at listOnTimeout (node:internal/timers:588:17)
at process.processTimers (node:internal/timers:523:7) {
framesToPop: 1
}
```
## Test plan
1. Without commit
```
git clone https://github.com/software-mansion/react-native-gesture-handler
cd react-native-gesture-handler
yarn install
cd apps/expo-example
yarn start
# new terminal (2)
cd react-native-gesture-handler/apps/expo-example
yarn ios
# Metro crashes in the first terminal with the Invariant Violation shown above.
```
2. With commit
```
git clone https://github.com/software-mansion/react-native-gesture-handler
cd react-native-gesture-handler
yarn install
cd apps/expo-example
yarn start
# new terminal (2)
cd react-native-gesture-handler/apps/expo-example
yarn ios
# Metro runs normally and no error is thrown in the first terminal
```.rnrepo-cache directory within the Metro config (#4262)1 parent 5d8102b commit 50cb5a6
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
0 commit comments