expo / expo/eas-cli

Cannot read properties of undefined (reading 'projectId') when running `eas init` after project recreation

Open
#3,018 0 comments 0 reactions 0 assignees View on GitHub
needs review
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 1h
Merged PRs (30d)
91

Description

### Build/Submit details page URL

_No response_

### Summary

After deleting and recreating my Expo project, I am unable to link my local project to EAS. The CLI fails with Cannot read properties of undefined (reading 'projectId') even after following all official troubleshooting steps.
Steps to Reproduce:
Deleted the project from the Expo dashboard.
Cleaned local .eas directory.
Verified app.json is correct (see below).
Ran eas init — CLI finds the remote project, but fails with the error.
What I Expected:
eas init should link my local project to the remote Expo project and update my config.
What Actually Happened:
The CLI fails with:
Cannot read properties of undefined (reading 'projectId')
Error: project:init command failed.

my app.json:
{
"expo": {
"name": "BridgeOS",
"slug": "bridgeos",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.Bridge.BridgeOS",
"buildNumber": "1"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.Bridge.BridgeOS",
"versionCode": 1
},
"plugins": [
"expo-router"
],
"web": {
"favicon": "./assets/favicon.png"
},
"owner": "veedhibhanushali",
"extra": {
"router": {
"origin": false
},
"eas": {
"projectId": "007748c8-9bb4-43eb-9c97-d55ce7a64334"
}
}
}
}

### Managed or bare?

iOS

### Environment

alis-MacBook-Pro bridge-app % npx expo-doctor
env: load .env
env: export EXPO_PUBLIC_OPENAI_API_KEY
15/15 checks passed. No issues detected!

### Error output

(base) veedhibhanushali@Veedhi-Bhanushalis-MacBook-Pro bridge-app % EXPO_DEBUG=true eas init
✔ Existing project found: @veedhibhanushali/bridge-app (ID: 007748c8-9bb4-43eb-9c97-d55ce7a64334). Link this project? … yes
Cannot read properties of undefined (reading 'projectId')
TypeError: Cannot read properties of undefined (reading 'projectId')
at isMatchingObject (/opt/homebrew/lib/node_modules/eas-cli/node_modules/@expo/config/build/Config.js:477:47)
at isMatchingObject (/opt/homebrew/lib/node_modules/eas-cli/node_modules/@expo/config/build/Config.js:473:12)
at isMatchingObject (/opt/homebrew/lib/node_modules/eas-cli/node_modules/@expo/config/build/Config.js:473:12)
at modifyConfigAsync (/opt/homebrew/lib/node_modules/eas-cli/node_modules/@expo/config/build/Config.js:383:39)
at async createOrModifyExpoConfigAsync (/opt/homebrew/lib/node_modules/eas-cli/build/project/expoConfig.js:15:16)
at async saveProjectIdToAppConfigAsync (/opt/homebrew/lib/node_modules/eas-cli/build/commandUtils/context/contextUtils/getProjectIdAsync.js:25:20)
at async ProjectInit.saveProjectIdAndLogSuccessAsync (/opt/homebrew/lib/node_modules/eas-cli/build/commands/project/init.js:37:9)
at async ProjectInit.initializeWithoutExplicitIDAsync (/opt/homebrew/lib/node_modules/eas-cli/build/commands/project/init.js:210:13)
at async ProjectInit.runAsync (/opt/homebrew/lib/node_modules/eas-cli/build/commands/project/init.js:304:32)
at async ProjectInit.run (/opt/homebrew/lib/node_modules/eas-cli/build/commandUtils/EasCommand.js:168:16)
Error: project:init command failed.

### Reproducible demo or steps to reproduce from a blank project

Cannot read properties of undefined (reading 'projectId')
TypeError: Cannot read properties of undefined (reading 'projectId')
...
Error: project:init command failed.
Expected:
Project should link successfully and not throw a projectId error.
Actual:
Fails with a TypeError related to projectId as shown above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.