Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker
Describe the bug
After running Amplify env add it would give me this error, I've downgraded to version 4.22 and it does not give me the error anymore.
✖ There was an error initializing your environment.
init failed
TypeError: Cannot read property 'provider' of undefined
at Object.updateConfigOnEnvInit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/provider-utils/awscloudformation/index.ts:310:82)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/index.ts:108:28
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18
at runMicrotasks (
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Amplify CLI Version
You can use amplify -v to check the amplify cli version on your system
4.23.0
To Reproduce
Steps to reproduce the behavior or terminal output if applicable
1, npm i -g @aws-amplify/[email protected]
2, amplify env add
Expected behavior
Once you finish the command prompt input for Amplify env add, it exits and give this error:
✔ Initialized provider successfully.
? Do you want to configure Lambda Triggers for Cognito? No
? Enter the name of the group to which users will be added.
✖ There was an error initializing your environment.
init failed
TypeError: Cannot read property 'provider' of undefined
at Object.updateConfigOnEnvInit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/provider-utils/awscloudformation/index.ts:310:82)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/index.ts:108:28
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18
at runMicrotasks (
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
node -v to check the node version on your systemAdditional context
Add any other context about the problem here.
Hi @ItsRLuo, this looks to be related to #4770. Can you share your amplify status?
@ItsRLuo Could you also provide the steps taken that lead up to this? Prior to running env add was there already a function added? was it already pushed?
@aws-amplify/cli version 4.23.1 has just been released. If you experience the same issue on the latest version, please comment below.
thanks @jhockett, no longer see the error in new version
Most helpful comment
thanks @jhockett, no longer see the error in new version