Skip to content
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

eas build fails when using .yarnrc.yml that contains relative path to files #2386

Open
okkes opened this issue May 19, 2024 · 4 comments
Open
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@okkes
Copy link

okkes commented May 19, 2024

Build/Submit details page URL

https://expo.dev/accounts/jinbu/projects/my-demo-expo-app/builds/e024d779-333e-4f13-87a9-83468cfc0d1d

Summary

eas build fails when using .yarnrc.yml that contains relative path to files (yarn install step)

image

Managed or bare?

Managed

Environment

not applicable

Error output

No response

Reproducible demo or steps to reproduce from a blank project

Not necessarily reproducing steps, but more context on the project that could help.

The .yarnrc.yml is pointing to specific yarn file as well as a plugin using relative path.

nodeLinker: node-modules

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
    spec: '@yarnpkg/plugin-interactive-tools'

yarnPath: .yarn/releases/yarn-3.5.1.cjs

Folder structure:

.yarn
│
├───plugins
│   └───@yarnpkg
│           plugin-interactive-tools.cjs
│
└───releases
        yarn-3.5.1.cjs

.yarnrc.yml

node_modules
|....

.gitignore file

!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.DS_Store
.env
.expo/
.idea
.idea/
.pnp.*
.yarn/*
*.jks
*.key
*.mobileprovision
*.orig.*
*.p12
*.p8
dist/
node_modules/
npm-debug.*
web-build/
@okkes okkes added the needs review Issue is ready to be reviewed by a maintainer label May 19, 2024
@okkes
Copy link
Author

okkes commented May 19, 2024

when using build with --local via github actions, I get similar error. When I replace the relative path with full path (to the checked out code directory), then it works. I might be able to get around with this issue within expo pipelines too, but I couldn't figure out where the files are stored in the agent.

Preferably, I wouldn't want to hardcode the path to these files

@AdamTyler
Copy link

I'm also running into this issue going through the EAS introduction tutorial when running eas build --platform android --profile development

I'm using yarn 4.3.1 but I get the error: Error: Cannot find module '/home/expo/workingdir/build/.yarn/releases/yarn-4.3.1.cjs'

@enaluz
Copy link

enaluz commented Aug 12, 2024

@AdamTyler Also getting this same issue. Did you figure out a solution?

@okkes
Copy link
Author

okkes commented Aug 14, 2024

I think I did fix it at some point. Can't exactly remember how, but I recently decided to just step away from yarn (I had some fingerprint version hashing issues, probably related to yarn.lock file not being used or something, causing different modules to be created)

Some interesting snippets that may help you out:

Changes in gitignore (because the yarn.cjs file was somehow being ignored)

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
...

.yarnrc.yml file (upgraded to yarn v4)

compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.1.cjs

changes in package.json (cant say which ones are actually needed and which arent):

{
  ...
  "scripts": {
    "eas-build-pre-install": "corepack enable",
    "build:preview": "eas build --profile preview",
   ...
  },
  "packageManager": "[email protected]",
  "volta": {
    "node": "18.19.0"
  },
  ...
}

and finally run the command using yarn
yarn run build:preview

mkraenz added a commit to mkraenz/teatime that referenced this issue Nov 30, 2024
…ingdir/build/.yarn/releases/yarn-1.22.19.cjs'` in EAS build on `nx build daily-questions`

expo/eas-cli#2386
mkraenz added a commit to mkraenz/teatime that referenced this issue Nov 30, 2024
…ule '/home/expo/workingdir/build/.yarn/releases/yarn-1.22.19.cjs'` in EAS build on `nx build daily-questions`

expo/eas-cli#2386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants