You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli@latest
If applicable, what version of Node.js are you using?
v12.18.3
Amplify CLI Version
4.48.0
What operating system are you using?
mac
Amplify Categories
auth, function, api, hosting
Amplify Commands
push
Describe the bug
I started out with amplify cli 4.48. I am working with another dev who is using version 4.50. If I update to 4.50 and then try to amplify push I get the following error: Cannot read property 'length' of undefined
After reverting to 4.48 I can amplify push again.
Additionally, I set up amplify frontend hosting with github ci before I noticed this problem. I went to check those frontend environments and it looks like after the other developer pushed to the github branches that those frontend environments are connected to, they stopped building successfully.
Looking at the errors on those environments, they are having the same problem I ran into when I tried to update my amplify CLI to 4.50.
2021-05-01T03:41:34.837Z [WARNING]: ✔ Initialized provider successfully. 2021-05-01T03:41:35.009Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud 2021-05-01T03:41:35.010Z [WARNING]: ✖ There was an error initializing your environment. 2021-05-01T03:41:35.013Z [INFO]: �[0mTypeError: Cannot read property 'length' of undefined�[0m
Expected behavior
I should be able to update my amplify vli and then amplify push without running into an error.
Also, my amplify frontend envs should be able to build.
Reproduction steps
Pull an amplify project while using amplify cli 4.48
update amplify cli to 4.50
try to amplify push
GraphQL schema(s)
# Put schemas below this line
Log output
# Put your logs below this line
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:121:99
at Array.forEach (<anonymous>)
at ApiGatewayAuthStack.createPoliciesFromResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:120:13)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:94:16
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:84:31
at Array.forEach (<anonymous>)
at new ApiGatewayAuthStack (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:62:23)
at createApiGatewayAuthResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:205:17)
at Object.consolidateApiGatewayPolicies (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:201:10)
at Object.createEnvLevelConstructs (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/env-level-constructs.ts:22:5)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:97:5)
at async Promise.all (index 0)
at providersPush (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/push-resources.ts:99:3)
at AmplifyToolkit.pushResources [as _pushResources] (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/push-resources.ts:75:7)
at Object.executeAmplifyCommand (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/index.ts:240:3)
at executePluginModuleCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:175:3)
at Object.executeCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:28:5)
at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:139:5)
An error occurred when pushing the function resource
Additional information
No response
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @jhaddock385. I'm going to close this as a duplicate of #7190. Please see the linked issue for a workaround. There should also be a fix in the next release.
Before opening, please confirm:
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli@latest
If applicable, what version of Node.js are you using?
v12.18.3
Amplify CLI Version
4.48.0
What operating system are you using?
mac
Amplify Categories
auth, function, api, hosting
Amplify Commands
push
Describe the bug
I started out with amplify cli 4.48. I am working with another dev who is using version 4.50. If I update to 4.50 and then try to amplify push I get the following error:
Cannot read property 'length' of undefined
After reverting to 4.48 I can amplify push again.
Additionally, I set up amplify frontend hosting with github ci before I noticed this problem. I went to check those frontend environments and it looks like after the other developer pushed to the github branches that those frontend environments are connected to, they stopped building successfully.
Looking at the errors on those environments, they are having the same problem I ran into when I tried to update my amplify CLI to 4.50.
2021-05-01T03:41:34.837Z [WARNING]: ✔ Initialized provider successfully. 2021-05-01T03:41:35.009Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud 2021-05-01T03:41:35.010Z [WARNING]: ✖ There was an error initializing your environment. 2021-05-01T03:41:35.013Z [INFO]: �[0mTypeError: Cannot read property 'length' of undefined�[0m
Expected behavior
I should be able to update my amplify vli and then amplify push without running into an error.
Also, my amplify frontend envs should be able to build.
Reproduction steps
GraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: