Cannot read properties of undefined (reading 'Region')
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.13.1
What operating system are you using?
Ubuntu
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Getting issue while creating new env using ampliy, earlier it was working fine
Describe the bug
Getting issue while creating new env using ampliy, earlier it was working fine
Expected behavior
Its should run smothly
Reproduction steps
Getting issue while creating new env using ampliy, earlier it was working fine
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- [x] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [x] I have removed any sensitive information from my code snippets and submission.
Hey @Jpatidar9, Thanks for bringing this to our attention. Could you please share more details about when you started seeing this error? Did it occur after upgrading the CLI version?
I had the same issue while trying to do deploy using cmd ampliy publish in Gitlab CI/CD pipeline with the latest amplify-cli v14.0.0 and node v18.20.8. Downgrading amplify-cli to v13.0.1 using npm install -g @aws-amplify/[email protected] worked for me.
Current vs Expected Behavior
Current Behavior (CLI v14.0.0)
$ amplify env add
# User provides environment name and authentication
🛑 Cannot read properties of undefined (reading 'Region')
# Operation fails completely
Expected Behavior
$ amplify env add
# User provides environment name and authentication
✅ Successfully initialized environment
# Environment creation completes successfully
Hi @Jpatidar9,
Thank you for reporting this issue. This appears to be a regression introduced in CLI v14.0.0 that affects Region property access during environment initialization. We've identified this as a systemic issue affecting multiple users and operations.
Immediate Workaround:
npm install -g @aws-amplify/[email protected]
Root Cause: The issue occurs in the amplify-service-manager during AWS configuration initialization where the Region property is accessed without proper null safety checks.
To help us resolve this issue, could you please provide:
-
Complete error logs with
--debugflag:amplify env add --debug -
Your AWS configuration method:
- AWS Profile
- SSO
- Access Keys
- Environment variables
-
Node.js version and operating system details
-
Project identifier from
amplify diagnose --send-report
This issue is being tracked as a P1 regression and we encourage community contributions to help resolve it. The fix would involve adding proper null safety checks and improved error handling in the AWS configuration initialization process.
Related Issues: #14244, #13778, #12777
We appreciate your patience and will prioritize this fix in the next patch release.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.