Skip to content

Commit

Permalink
Fix Expo Dev Client CI (#5329)
Browse files Browse the repository at this point in the history
## Summary

By default, Expo uses npm as a package manager. When you execute `npm
install <library>`, npm installs the dependencies and runs the `prepare`
script from the library. This setup generally works well. However, on
our CI environment, we install Reanimated directly from the branch,
without the autogenerated files and types. These files are usually
generated by the `prepare` command. The problem arises with the plugin
since there may be a Babel version mismatch between Expo and the plugin.
This mismatch causes the plugin build to fail, resulting in an error.
```
npm ERR!   Type 'import("/home/runner/.npm/_cacache/tmp/git-clonesZNSUp/plugin/node_modules/@babel/types/lib/index").FunctionExpression' is not assignable to type 'babel.types.FunctionExpression'.
npm ERR!     Types of property 'id' are incompatible.
npm ERR!       Type 'import("/home/runner/.npm/_cacache/tmp/git-clonesZNSUp/plugin/node_modules/@babel/types/lib/index").Identifier | null | undefined' is not assignable to type 'babel.types.Identifier | null | undefined'.
```
More logs here:
https://github.com/software-mansion/react-native-reanimated/actions/runs/6697889174/job/18198727220

My solution is to use the nightly version of Reanimated from NPM. If
anyone has a better approach, I'm open to discussion and would love to
hear alternative suggestions. 🤗

## Test plan

See CI reults
  • Loading branch information
piaskowyk committed Nov 10, 2023
1 parent c8aa6f6 commit 2e6c7d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-expo-dev-client-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
paths:
- .github/workflows/check-expo-dev-client-nightly.yml
schedule:
- cron: '37 19 * * *'
- cron: '0 0 * * *' # after publishing new nightly version on NPM
workflow_dispatch:

env:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install github:software-mansion/react-native-reanimated#${{ github.ref }}
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricIOS
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install github:software-mansion/react-native-reanimated
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricAndroid
Expand Down

0 comments on commit 2e6c7d3

Please sign in to comment.