Amplify push, status and env Cannot read property 'forEach' of undefined TypeError: Cannot read property 'forEach' of undefined - amplify-cli

Describe the bug amplify status -> Cannot read property 'forEach' of undefined TypeError: Cannot read property 'forEach' of undefined at AmplifyToolkit.showHelpfulProviderLinks show-helpful-provider-links.js:12:15

amplify env checkout Cannot read property 'forEach' of undefined TypeError: Cannot read property 'forEach' of undefined checkout.js:28:45

amplify pull --restore Cannot read property 'forEach' of undefined TypeError: Cannot read property 'forEach' of undefined initialize-env.js:49:49

all amplify commands seem to fail when reading providers.forEach. For backend, our project has auth, storage and api

Amplify CLI Version amplify -v -> 4.43.0

To Reproduce any env related amplify command

Desktop (please complete the following information):

  • OS: Windows
  • Node Version. v10.15.3
Asked Oct 03 '21 23:10
avatar sanjaykataria10
sanjaykataria10

4 Answer:

@sanjaykataria10 Could you answer the following 1. Is Amplify CLI installed gloablly (using npm install -g @aws-amplify/cli) 2. Is this project created in a different machine 3. Could you share the content of <proj-root>/amplify/.config/project-config.json.

1
Answered Feb 17 '21 at 02:56
avatar  of yuth
yuth

@yuth

  1. Amplify CLI installed globally
  2. project was created in my m/c but I have other developers working on it
  3. here is the project config on my local. { "version": "3.0" } when reviewing on github looks like this file was deleted by a dev. (prev contents below) { "providers": [ "awscloudformation" ], "projectName": "amplify-jobs-app", "version": "3.0", "frontend": "javascript", "javascript": { "framework": "react", "config": { "SourceDir": "src", "DistributionDir": "build", "BuildCommand": "npm.cmd run-script build", "StartCommand": "npm.cmd run-script start" } } }

Thanks.

1
Answered Feb 17 '21 at 03:55
avatar  of sanjaykataria10
sanjaykataria10

I have restored the project-config and am able to run amplify env commands. Thanks !

1
Answered Feb 17 '21 at 04:49
avatar  of sanjaykataria10
sanjaykataria10

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

1
Answered May 25 '21 at 03:19
avatar  of github-actions[bot]
github-actions[bot]