-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on local build Expo EAS with Yarn 4.1.1 #22631
Comments
I haven't check yet the post install script from Nx example /**
* This script is used to patch the '@nx/expo' package to work with EAS Build.
* It is run as a eas-build-post-install script in the 'package.json' of expo app.
* It is executed as 'node tools/scripts/eas-build-post-install.mjs <workspace root> <project root>'
* It will create a symlink from the project's node_modules to the workspace's node_modules.
*/
import { existsSync, symlink } from 'node:fs'
import { join } from 'node:path'
const [workspaceRoot, projectRoot] = process.argv.slice(2)
if (existsSync(join(workspaceRoot, 'node_modules'))) {
console.log('Symlink already exists')
process.exit(0)
}
symlink(
join(projectRoot, 'node_modules'),
join(workspaceRoot, 'node_modules'),
'dir',
err => {
if (err) console.log(err)
else {
console.log('Symlink created')
}
},
) |
i tried to build with eas locally. here are what i did:
|
@xiongemi, do you have a solution for the latest versions? |
React Native 0.74 https://reactnative.dev/blog/2024/04/22/release-0.74 has Yarn 3 as the default package manager for new projects. Not npm. It's a good moment to handle EAS build v7 and v8 in Expo https://github.com/expo/eas-cli/releases with Yarn v4. 😉 |
the quickest workaround would be: go the app and run |
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #22631 (cherry picked from commit 81acded)
another quick fix would be in package.json, add your app and library to workspaces, something like:
|
It didn't work. |
what error are you getting? |
No idea anymore. I stopped using Nx for my monorepos with Expo. I experienced too many errors (I opened issues, but not really solved or take months). There's a need for Nx with RN (people starring https://github.com/guillempuche/nx-expo-next-tamagui), but the community doesn't push for RN + Nx (just read new PR or issues in Nx) I'm using straight Yarn for my monorepo and some Turborepo. |
@guillempuche same here. I've used Nx + Expo for a year, and it was a year of struggling with bugs and errors. Now I've ended up with plain Yarn 4 Workspaces and kept Nx only as a task runner and graph builder (to determine what is affected). Nx may be good for library-oriented monorepos, but I found it inappropriate for application-centric monorepos with web, API, or mobile apps. It's sad that I wasted a year to figure that out because the official docs describe a lot of plugins and executors, which are nothing more than built-in workarounds for Nx-based problems like path resolving. When using Nx, you get caught in vendor lock-in, which is probably not what you'd want. It's sad that Nx is the most mentioned tool for monorepos, but in reality, you end up struggling with a bunch of errors. It's definitely not what a production-ready tool should be. For additional context, I used Nx in a monorepo with TS libraries, web and mobile applications, and a NestJS backend. Now I've switched to Yarn Workspaces, migrated the web project to Vite, and everything works like a charm. Most importantly, it all works predictably. |
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes nrwl#22631
This PR: #26992 which is closing this issue, has broken yarn v4 for me. EAS does not seem to work anymore. As mentioned by @xiongemi
This workaround ☝️ used to work for me with NX 19.6.4, but the PR seems to break EAS and I no longer can build with EAS anymore. Any suggestions how to fix this? |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Run EAS build with Nx EAS Pre Install script with Yarn 4.1 throws an error.
Expected Behavior
Build locally the app on my Android emulator.
GitHub Repo
No response
Steps to Reproduce
//
apps/xiroi-expo/project.json
//
tools/scripts/eas-build-pre-install.mjs
yarn exec nx run xiroi-expo:build-dev-android
Nx Report
Failure Logs
Package Manager Version
yarn 4.1.1
Operating System
Additional Information
The
package.json
has Yarn configured, check it below. You can also do it runningyarn set version berry
.//
.yarnrc.yml
Other version of packages:
expo
50.0.14eas-cli
7.6.2I read https://docs.expo.dev/build-reference/npm-cache-with-yarn/, but I don't know what to do. According to ChatGTP:
The text was updated successfully, but these errors were encountered: