expo eject is failing: The "path" argument must be of type string. Received undefined

Hello,

Command “expo eject” is failing as shown below. Any advise for fixing the issue?

$ expo eject
Your git working tree is clean
To revert the changes after this command completes, you can run the following:
git clean --force && git reset --hard

:memo: Android package Learn more: https://expo.fyi/android-package

? What would you like your Android package name to be? com.enterprise.reactnativepoc

:memo: iOS Bundle Identifier Learn more: https://expo.fyi/bundle-identifier

? What would you like your iOS bundle identifier to be? com.enterprise.reactnativepoc

:heavy_check_mark: Created native projects | /ios, /android already created
:heavy_check_mark: Added Metro bundler configuration.
:heavy_check_mark: Updated package.json and added index.js entry point for iOS and Android.

  • Removed “main”: “node_modules/expo/AppEntry.js” from package.json because we recommend using index.js as main instead.

:package: Using npm to install packages.

:heavy_check_mark: Cleaned JavaScript dependencies.
:heavy_check_mark: Installed JavaScript dependencies.
The “path” argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined
** at validateString (internal/validators.js:120:11)**
** at Object.resolve (path.js:980:7)**
** at new pbxProject (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/node_modules/xcode/lib/pbxProject.js:35:26)**
** at Object.pbxProject [as project] (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/node_modules/xcode/lib/pbxProject.js:33:16)**
** at Object.getPbxproj (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/node_modules/@expo/config/src/ios/utils/Xcodeproj.ts:164:25)**
** at Object.setDeviceFamily (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/node_modules/@expo/config/src/ios/DeviceFamily.ts:52:19)**
** at configureIOSProjectAsync (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/src/commands/apply/configureIOSProjectAsync.ts:17:26)**
** at configureIOSStepAsync (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/src/commands/eject/Eject.ts:166:3)**
** at Object.ejectAsync (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/src/commands/eject/Eject.ts:81:3)**
** at action (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/src/commands/eject.ts:48:5)**
** at Command. (/Users/eslalaguse/.npm-global/lib/node_modules/expo-cli/src/exp.ts:302:7)**

Expo CLI 3.27.8 environment info:
System:
OS: macOS 10.15.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.18.4 - /usr/local/bin/node
npm: 6.14.6 - /usr/local/bin/npm
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
npmPackages:
expo: ~39.0.2 => 39.0.3
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: ~0.63.2 => 0.63.2
react-native-web: ~0.13.12 => 0.13.13
npmGlobalPackages:
expo-cli: 3.27.8
Expo Workflow: bare

2 Likes

Having this issue as well.

same here!

Same here

 expo diagnostics

  Expo CLI 3.27.10 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.7 - ~/.nvm/versions/node/v12.18.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.9.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
      Android SDK:
        API Levels: 29, 30
        Build Tools: 28.0.3, 29.0.2, 30.0.1
        System Images: android-29 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6514223
      Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ^0.12.16 => 0.12.32 
      expo: ^39.0.0 => 39.0.3 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.2 => 0.63.2 
      react-native-web: ~0.13.7 => 0.13.13 
    npmGlobalPackages:
      expo-cli: 3.27.10
    Expo Workflow: bare

Exact same issue as well, running Expo SDK 39. Facing on SDK 38 as well, however.

 Expo CLI 3.27.13 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.3 - /usr/local/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.8 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.9.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^39.0.0 => 39.0.3 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.3 => 0.63.3 
      react-native-web: ~0.13.7 => 0.13.14 
    npmGlobalPackages:
      expo-cli: 3.27.13
    Expo Workflow: bare

please share a project where we can run expo eject and reproduce this, thanks!

I made an issue to track this here: https://github.com/expo/expo-cli/issues/2753

it may be related to the device family configuration (derived from supportsTablet or isTabletOnly) in your app config.

So I tried creating a new demo project to demonstrate the issue, but seems that expo eject works fine on a fresh app. I cannot share the actual project where I’m experiencing the issue as it is for my work. Sorry I’m not able to provide more, hopefully others who are facing this can share something.

Thanks for the response and for making the issue. Would you mind elaborating on the device family configuration, please? I have the following in my app config:

 "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "chat.watson.ai"
    },

ok it seems unrelated to that in your case then. can you share more information? notice in the original post the user shared the full log of running the command which included valuable information

Sure, here is my full output:

expo eject --npm
Warning! Your git working tree is dirty.
It's recommended to commit all your changes before proceeding, so you can revert the changes made by this command if necessary.

✔ Would you like to proceed? … yes

📝  Android package Learn more: https://expo.fyi/android-package

? What would you like your Android package name to be? chat.demo.app

📝  iOS Bundle Identifier Learn more: https://expo.fyi/bundle-identifier

? What would you like your iOS bundle identifier to be? chat.demo.app

✔ Created native projects | /ios, /index.js already created
✔ Added Metro bundler configuration.
✔ Updated package.json and added index.js entry point for iOS and Android.
- Removed "main": "node_modules/expo/AppEntry.js" from package.json because we recommend using index.js as main instead.

📦 Using npm to install packages.

✔ Cleaned JavaScript dependencies.
✔ Installed JavaScript dependencies.
The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:120:11)
    at Object.resolve (path.js:980:7)
    at new pbxProject (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/node_modules/xcode/lib/pbxProject.js:35:26)
    at Object.pbxProject [as project] (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/node_modules/xcode/lib/pbxProject.js:33:16)
    at Object.getPbxproj (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/src/ios/utils/Xcodeproj.ts:164:25)
    at Object.setDeviceFamily (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/src/ios/DeviceFamily.ts:52:19)
    at configureIOSProjectAsync (/usr/local/lib/node_modules/expo-cli/src/commands/apply/configureIOSProjectAsync.ts:17:26)
    at configureIOSStepAsync (/usr/local/lib/node_modules/expo-cli/src/commands/eject/Eject.ts:165:3)
    at Object.ejectAsync (/usr/local/lib/node_modules/expo-cli/src/commands/eject/Eject.ts:80:3)
    at action (/usr/local/lib/node_modules/expo-cli/src/commands/eject.ts:49:5)
    at Command.<anonymous> (/usr/local/lib/node_modules/expo-cli/src/exp.ts:331:7)

Please, find below the app source code that is causing the error described in this thread:
reactnative-colorcatalog-app.zip

Link is expiring in a week.

So I managed to get expo eject to work by changing the boolean value of the supportsTablet key in app.json to a string, as such:

"ios": {
      "supportsTablet": "true",
      "bundleIdentifier": "com.chat.bot"
    }

Was able to successfully eject and generate the iOS and Android project files. However, when I try to actually launch the iOS app from Xcode, I am hit with a brand new issue, errors about expo-update exactly as described in the Git issue linked below.

Same problem with me.


  Expo CLI 3.27.14 environment info:
    System:
      OS: Windows 10 10.0.19041
    Binaries:
      Node: 14.5.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - C:\Users\DevD\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
    SDKs:
      Android SDK:
        API Levels: 28, 29, 30
        Build Tools: 28.0.3, 30.0.0, 30.0.1
        System Images: android-29 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: Version  4.0.0.0 AI-193.6911.18.40.6626763
    npmPackages:
      expo: ~38.0.8 => 38.0.8 
      react: ~16.11.0 => 16.11.0 
      react-dom: ~16.11.0 => 16.11.0 
      react-native: ~0.62.2 => 0.62.2 
      react-native-web: ~0.11.7 => 0.11.7 
    Expo Workflow: bare


√ Created native projects | /ios, /android already created
√ Added Metro bundler configuration.
√ Updated package.json and added index.js entry point for iOS and Android.
- Removed "main": "node_modules/expo/AppEntry.js" from package.json because we recommend using index.js as main instead.

� Using npm to install packages.

√ Cleaned JavaScript dependencies.
√ Installed JavaScript dependencies.
The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:121:11)
    at Object.resolve (path.js:139:9)
    at new pbxProject (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\config\node_modules\xcode\lib\pbxProject.js:35:26)
    at Object.pbxProject [as project] (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\config\node_modules\xcode\lib\pbxProject.js:33:16)
    at Object.getPbxproj (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\config\src\ios\utils\Xcodeproj.ts:164:25)
    at Object.setDeviceFamily (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\config\src\ios\DeviceFamily.ts:52:19)
    at configureIOSProjectAsync (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\src\commands\apply\configureIOSProjectAsync.ts:17:26)
    at configureIOSStepAsync (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\src\commands\eject\Eject.ts:165:3)
    at Object.ejectAsync (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\src\commands\eject\Eject.ts:80:3)
    at action (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\src\commands\eject.ts:49:5)
    at Command.<anonymous> (C:\Users\DevD\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:331:7)

Can confirm this happens when ios.supportsTablet = false