Open rudfoss opened 6 months ago
Issue open on expo-cli: https://github.com/expo/eas-cli/issues/2267
It appears that the .npmrc
file is required for the installation on EAS to run correctly. Once I copied the .npmrc
file to the nx-expo-test
root folder the build works. Maybe that should also be part of the generator for pnpm-based repos?
.npmrc
strict-peer-dependencies=false
auto-install-peers=true
node-linker=hoisted
apps/nx-expo-test/package.json
Add && cp .npmrc apps/nx-expo-test
to the end of the eas-build-pre-install
script so that it is also copied along with the lock file.
{
"name": "nx-expo-test",
"version": "0.0.1",
"private": true,
"dependencies": {
"@testing-library/jest-native": "*",
"@testing-library/react-native": "*",
"metro-config": "*",
"react-native": "*",
"expo": "*",
"react-native-svg": "*",
"react-native-web": "*"
},
"scripts": {
"eas-build-pre-install": "cd ../../ && node tools/scripts/eas-build-pre-install.mjs . apps/nx-expo-test && cp pnpm-lock.yaml apps/nx-expo-test && cp .npmrc apps/nx-expo-test",
"eas-build-post-install": "cd ../../ && node tools/scripts/eas-build-post-install.mjs . apps/nx-expo-test"
}
}
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏
Current Behavior
Running EAS build for an Expo app in a monorepo fails. The cause seems to be that the
eas-build-pre-install
andeas-build-post-install
do not take effect correctly and the defaultpackage.json
file in the app is used instead of the full one.Expected Behavior
Eas build should work using a newly generated expo app in an Nx monorepo.
GitHub Repo
https://github.com/rudfoss/nx-expo-test
Steps to Reproduce
See readme of repro repo
Create workspace
Update
.npmrc
Reinstall dependencies
Install expo plugin
Generate expo app
Add eas-cli dependency
Add eas project id and identifiers to app.json
"android": { "package": "com.thr.nxexpotest" },
"extra": { "eas": { "projectId": "b9e09a49-29bb-459c-9984-1998087378b7" } }
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
This might be an issue with the EAS build agents directly, but it is hard to debug as I cannot easily see the full file structure to determine if the package.json file is correct. The pre and post hooks seem to work without issues.