Commit 71647bf
fix(pods): Fix invalid
## Description
Related:
software-mansion/react-native-gesture-handler#4232
(same fix for `react-native-gesture-handler`)
The pod scripts attempt to resolve `react-native/package.json` to get to
the `version` and perform a version check. It however performs a
redundant `react-native/../react-native` resolution i.e. it essentially
performs `path.dirname(require.resolve('react-native/package.json'))`
(correct), but then joins this with `${dir}/..`, then re-joins this with
`react-native`.
Re-entering the `react-native` directory can be invalid in case of
symlinks in the `node_modules` structure. The easiest way to reproduce
an issue is to use react-native-tvos's pattern of aliasing
`"react-native": "npm:react-native-tvos@x.x.x"`. With isolated
dependencies this will point a symlink at a directory that's named
`react-native-tvos` and not `react-native`. The also applies to local
`link:` dependency specifiers. Essentially, the directory name
`react-native` is unnecessarily enforced.
This would lead to a cryptic `file: no implicit conversion of nil into
String.` error
## Test plan
- Existing `pod install` in working projects should continue passing
unchanged
-
https://github.com/kitten/douglowder--with-monorepo-tv-test/tree/init-pnpm
- `pnpm i` then in `apps/tv` run `pnpm prebuild` (which runs `pod
install`)
---------
Co-authored-by: Tomasz Żelawski <tzelawski@gmail.com>react-native/../react-native resolution for aliases (#9592)1 parent 831b317 commit 71647bf
2 files changed
Lines changed: 16 additions & 16 deletions
File tree
- packages
- react-native-reanimated/scripts
- react-native-worklets/scripts
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments