amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Cannot read properties of undefined (reading 'Region')

Open Jpatidar9 opened this issue 7 months ago • 1 comments

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.

Jpatidar9 avatar May 12 '25 06:05 Jpatidar9

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?

AnilMaktala avatar Jun 02 '25 14:06 AnilMaktala

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.

bhattasuraj76 avatar Jul 03 '25 15:07 bhattasuraj76

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:

  1. Complete error logs with --debug flag:

    amplify env add --debug
    
  2. Your AWS configuration method:

    • AWS Profile
    • SSO
    • Access Keys
    • Environment variables
  3. Node.js version and operating system details

  4. 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.

pahud avatar Aug 20 '25 16:08 pahud

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.

github-actions[bot] avatar Aug 20 '25 16:08 github-actions[bot]