EAS build with git submodules

Hi!
I have a repository which uses git submodules. It is configured corretly, or at least it worked without problems with expo build command, but eas build throws an error in “Run gradlew” phase:

[stderr] Error: @build-script-error-begin
[stderr] Error loading assets JSON from Metro. Ensure you've followed all expo-updates installation steps correctly. Unable to resolve module ./src/common/components/CustomSnackbar from /build/workingdir/build/App.js: 
[stderr] None of these files exist:
[stderr]   * src/common/components/CustomSnackbar(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
[stderr]   * src/common/components/CustomSnackbar/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
[stderr]   21 | import AppNavigator from './src/router';
[stderr]   22 | import { navigationRef } from './src/router/RootNavigation';
[stderr] > 23 | import CustomSnackbar from './src/common/components/CustomSnackbar';

It seems the problem is that it cannot see the files in the folder attached with the subrepo ./src/common. I found some docs about monorepos, but I don’t know how I can configure to make it work with subrepos. Thanks for any help!

I don’t think it will work with submodules, the way we upload project to the workers is by

  • git clone --depth=1 path_to_repo
  • create tar of that shallow clone

There might be workaround for that, if you would run git submodule update --init in npm hook. If repo is public it should be easy, if not you can upload ssh key via EAS Secrets.

we might support that directly in the future, but it’s quite niche use case. It worked with expo build because for old builds js bundle was created locally and only that was uploaded to the server but with eas we need to uplaod everything.

Thanks for the clarification! Yes I’ve already tried git submodule update --init --recursive in eas-build-pre-install hook, but it threw a permission error since the repo is private. I didn’t know how to proceed with this issue, or it’s worth it or not, but then I’ll read through the docs about EAS Secrets, and give it a try. I’ll let you know if I have a progress on this.