expo / eas-cli

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

Post install hook failing on ios build #2707

Open ahmedprusevic opened 2 days ago

ahmedprusevic commented 2 days ago

Build/Submit details page URL

https://expo.dev/accounts/ahmedprusevic/projects/polaris/builds/b3057f65-7eb8-4b53-a245-55ba8cb894c2

Summary

Running post install hook on eas pipeline fails on ios, it is trying to run openapi-generator-cli generate command which is supposed to make http request to my server (not sure weather this makes any change) ,

node version in nvm is v18.18.0 to match the one from the image

It is passing on android build so really wierd issue

Managed or bare?

Bare

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: macOS 15.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.15.1 - ~/.nvm/versions/node/v20.15.1/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v20.15.1/bin/yarn
      npm: 10.7.0 - ~/.nvm/versions/node/v20.15.1/bin/npm
    Managers:
      CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    IDEs:
      Android Studio: 2024.1 AI-241.19072.14.2412.12360217
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~51.0.36 => 51.0.36 
      expo-router: ~3.5.23 => 3.5.23 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.74.5 => 0.74.5 
      react-native-web: ~0.19.10 => 0.19.12 
    npmGlobalPackages:
      eas-cli: 13.2.3
    Expo Workflow: bare

Detailed check results:

The following issues were found when validating your dependencies against React Native Directory:
No metadata available: @dev-plugins/react-query, @hookform/resolvers, date-fns, i18next, jotai, lodash.debounce, react-native-chart-kit, styled-components, zod
Advice: 
- Update React Native Directory to include metadata for unknown packages. Alternatively, set expo.doctor.reactNativeDirectoryCheck.listUnknownPackages in package.json to false to skip warnings about packages with no metadata, if the warning is not relevant.

The following packages should be updated for best compatibility with the installed expo version:
  expo@51.0.36 - expected version: ~51.0.39
  expo-dev-client@4.0.27 - expected version: ~4.0.29
  expo-router@3.5.23 - expected version: ~3.5.24
  expo-splash-screen@0.27.6 - expected version: ~0.27.7
  react-native-svg@15.7.1 - expected version: 15.2.0
Your project may not work correctly until you install the expected versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.

Error output

No response

Reproducible demo or steps to reproduce from a blank project

try running openapi-generator-cli generate command that fetches schema from some server in eas-build-post-install hook on ios build

szdziedzic commented 2 days ago

I'm not sure what's wrong here, but can you just try to run it as npx -y @openapitools/openapi-generator-cli ...?

ahmedprusevic commented 2 days ago

I've tried that as well (still failing) attaching screen shot for the reference

Screenshot 2024-11-20 at 10 50 05
szdziedzic commented 2 days ago

what does openapischema.js do inside?

ahmedprusevic commented 2 days ago

Just generates openapitools.json based on env copying file contents here

const output = {
  $schema:
    "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  spaces: 2,
  "generator-cli": {
    version: "7.10.0",
    generators: {
      "v3.0": {
        generatorName: "typescript-axios",
        output: "openapi",
        // eslint-disable-next-line no-undef
        inputSpec: `${process.env.EXPO_PUBLIC_API_URL}/swagger/doc.json`,
      },
    },
  },
}
const jsonString = JSON.stringify(output)

fs.writeFileSync("openapitools.json", jsonString)

double checked weather env variable is present in eas.json it is, since the same command passes for android build