expo: EAS build crash when the entryfile is not index.js and ENTRY_FILE variable is not set

Summary

When you’re entryfile is not index.js(for example, index.ts), EAS crash when trying to generate the app.manifest for expo-updates (Pods/EXUpdates). There’s no precise error when the issue occured and is hard to debug.

The reason is the projectRoot variable is undefined when the entryFile cannot be resolved. And a crash happen when the script reach this line, because you cannot change the current directory with undefined. So the script should return an understandable error when the projectRoot variable is undefined before the process.chdir(projectRoot).

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

43

Environment

Expo CLI 4.13.0 environment info:
  System:
    OS: macOS 12.0
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
    Watchman: 2021.11.01.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
  IDEs:
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  npmPackages:
    react: 17.0.1 => 17.0.1
    react-dom: 17.0.1 => 17.0.1
    react-native: 0.64.3 => 0.64.3
    react-native-web: 0.17.1 => 0.17.1
  npmGlobalPackages:
    expo-cli: 4.13.0
  Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

The bug is resolved when you rename index.ts to index.js, but the current error is hard to understand.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Figured I would chime in on this to also say that renaming index.ts to index.js solved the problem. Super weird imo that this has been a known issue since 2021 but no fix. Issue should be re-opened.

I encountered this issue with expo@48 and Typescript.

Fixed it by renaming index.ts to index.js

I encountered this issue with expo@48 and Typescript.

Fixed it by renaming index.ts to index.js

Solved it for me, thank you! I was afraid of doing so, but noticed there is only one import and is not typescript specific at all!

My issue was related to the latest bug in SDK47.
Just in case someone else ended up here, this is what fixed my issue. Expo 47: console.log in app.config.ts crashes build in expo-updates/scripts/createManifest.js

@MaxInMoon @frednomoon You guys are right. Renaming index.ts to index.js is the way to go! Ty.

@liemdo Yes. You just have to rename your entry file to index.js and remove any TS code from the file.