Open letsbelopez opened 2 years ago
This may be related, but I noticed our Post Env Add event stopped working because of a similar issue.
Here's the event handler: https://github.com/aws-amplify/amplify-cli/blob/dev/packages/amplify-util-uibuilder/src/event-handlers/handle-PostEnvAdd.ts#L11
And this line hits the error:
TypeError: Cannot read property 'awscloudformation' of undefined
This error only shows with the --debug
flag
Before opening, please confirm:
How did you install the Amplify CLI?
yarn setup-dev
If applicable, what version of Node.js are you using?
v17.3.1
Amplify CLI Version
10.3.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
no
Amplify Categories
Not applicable
Amplify Commands
push
Describe the bug
I'm developing a new event handler, Pre Push, for the amplify-util-uibuilder package. Here is my feature branch with the handler: https://github.com/letsbelopez/amplify-cli/blob/util-uibuilder/detached-forms/packages/amplify-util-uibuilder/src/event-handlers/handle-PrePush.ts#L10
While developing the Pre Push handler, I had access the
context.exeInfo.projectConfig
. Checking this object verifies we have the right context to continue executing the pre push handler. Here is the check: https://github.com/letsbelopez/amplify-cli/blob/util-uibuilder/detached-forms/packages/amplify-util-uibuilder/src/commands/utils/shouldRenderComponents.ts#L20I just rebased my commit with the dev branch, and now
context.exeInfo
is not defined inside the Pre Push handler. It is defined on Post Pull and Post Push though.Expected behavior
context.exeInfo.projectConfig
is defined on a Pre Push event.Reproduction steps
context.exeInfo.projectConfig
definedcontext.exeInfo.projectConfig
will be definedGraphQL schema(s)
Project Identifier
9726834578f7eb008dd7840e038459ec
inside a non prod environment if that makes a difference
Log output
Additional information
No response