Commit 9a9f8b4
fix(pods): Fix invalid
## Description
Related:
software-mansion/react-native-reanimated#9592
(same fix for `react-native-reanimated` and `react-native-worklets`)
The pod script attempts 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: Michał Bert <63123542+m-bert@users.noreply.github.com>react-native/../react-native resolution for aliases (#4232)1 parent f417709 commit 9a9f8b4
2 files changed
Lines changed: 7 additions & 7 deletions
File tree
- packages/react-native-gesture-handler
- scripts
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments