EAS Build Task :app:bundleReleaseJsAndAssets Error

Hi,

This is just to help others that might encounter the same error as we did, and maybe a request to update docs / build tooling :slight_smile:

We kept getting following error:

> Task :app:bundleReleaseJsAndAssets
Error: Unable to resolve module ./App from /build/workingdir/build/index.js: 
None of these files exist:
  * App(.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)
  * App/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)
  2 | import { registerRootComponent } from 'expo';
  3 | 
> 4 | import App from './App';
    |                  ^
  5 | 
  6 | // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
  7 | // It also ensures that whether you load the app in Expo Go or in a native build,
    at ModuleResolver.resolveDependency (/build/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
    at DependencyGraph.resolveDependency (/build/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
    at Object.resolve (/build/workingdir/build/node_modules/metro/src/lib/transformHelpers.js:271:42)
    at resolve (/build/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:571:33)
    at Array.reduce (<anonymous>)
    at resolveDependencies (/build/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:586:33)
    at /build/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:587:26
    at /build/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/build/workingdir/build/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
[stderr] error Unable to resolve module ./App from /build/workingdir/build/index.js: 
[stderr] None of these files exist:
[stderr]   * App(.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]   * App/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]   2 | import { registerRootComponent } from 'expo';
[stderr]   3 | 
[stderr] > 4 | import App from './App';
[stderr]     |                  ^
[stderr]   5 | 
[stderr]   6 | // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
[stderr]   7 | // It also ensures that whether you load the app in Expo Go or in a native build,. Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
> Task :unimodules-permissions-interface:compileReleaseKotlin
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets'.
[stderr] > Process 'command 'node'' finished with non-zero exit value 1
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 1m 41s

The error is that the build tool cannot find the entry point of our app. We have a custom entry point and our app.json file specifies that entry point. But that is ignored by the build tool.

First we tried with an index.js file in our root folder, inspired by the minimal expo example

That didn’t work either. Then we created a new project with newest version of expo CLI (typescript and react navigation option), and tried to build that, it worked.

We noticed the entry file in root was called App.tsx.

We then renamed our index.js file to App.tsx, and it worked!

End of story. Hope it helps someone

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.