expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
766 stars 81 forks source link

Eas build ios in monorepo fail because internal package has been found but main doesn't exist. #2463

Closed FedeRBeije closed 4 days ago

FedeRBeije commented 1 month ago

Build/Submit details page URL

https://expo.dev/accounts/retailplatform/projects/my-presenter-test/builds/bfd5a51b-d0f2-48d4-b53a-02bb2737c04b

Summary

It always work fine but since today i'm not more able to build because eas build fail.

The errors said that an internal packages has been found but is main does not exist.

in local all works fine.

the packages is also a githubs npm package.

inside package.json it is write down like this:

"@package_name": "*",

Managed or bare?

managed

Environment

expo-env-info 1.2.0 environment info: System: OS: macOS 14.5 Shell: 5.9 - /bin/zsh Binaries: Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node npm: 10.8.1 - ~/.nvm/versions/node/v18.19.0/bin/npm Managers: CocoaPods: 1.15.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5 IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 15.4/15F31d - /usr/bin/xcodebuild npmGlobalPackages: eas-cli: 10.2.0 Expo Workflow: managed

Error output

❌ Metro encountered an error: While trying to resolve module @eng-retail-platform/front-services from file /Users/expo/workingdir/build/apps/native/my-presenter/src/services/axios-config.ts, the package /Users/expo/workingdir/build/node_modules/@eng-retail-platform/front-services/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/expo/workingdir/build/node_modules/@eng-retail-platform/front-services/dist/index.js. Indeed, none of these files exist:

Reproducible demo or steps to reproduce from a blank project

szdziedzic commented 1 month ago

Hi @FedeRBeije,

It seems like the build you gave a link to is deleted. Can I get the link to existing build, please?

FedeRBeije commented 1 month ago

Hi @szdziedzic sorry, my PM deleted all. In the hand we'have been able to build up the application but not quite sure why we need to do this as a work around.

The solution has been to use eas-build-post-install script and make the worker do the build for the package.

The script is :

 eas-build-post-install": "cd ../../.. && npx turbo build --filter=name_of_package

There are two really strange thinks with this solution:

  1. In this app i've other 2 packages that are internal and they works just fine.
  2. The build of the packages is a process that it always done before building app, i don't get why eas build wasn't able to find the files.

As i written above the different between this package and the others is that this one it is also been public by npm registry with github but i don't get how this can be a problem.

szdziedzic commented 1 month ago

I have some questions.

  1. So this package can be accessed through a public NPM registry and a private one, right? Which version of a package is installed? Are the versions of this package published through 2 registries the same?
  2. Does the package work for you locally if you install your node modules locally without hacks like cd ../../&& npx turbo build --filter=name_of_package?
  3. It can be helpful to share if you have a URL of any (even a successful build with npx turbo solution).
FedeRBeije commented 1 month ago

I have some questions.

  1. So this package can be accessed through a public NPM registry and a private one, right? Which version of a package is installed? Are the versions of this package published through 2 registries the same?
  2. Does the package work for you locally if you install your node modules locally without hacks like cd ../../&& npx turbo build --filter=name_of_package?
  3. It can be helpful to share if you have a URL of any (even a successful build with npx turbo solution).

Sorry for the late answer,

  1. It is public by organization on github with npm. It exist both locale in mono's and remote. i use * as should reflect and use the last change i made inside my package even if i didn't publish a new version yet.
  2. The package works correctly both locally and installed via npm. About cd etc.., i need to do that because eas is not able to use the dist folder that i make before start eas build. It looks like it can't find it.
  3. build link

Thank you for your time.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 4 days ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.