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
Since policy management has now changed, my templates probably missing data.
Current Environment: dev
Category
Resource name
Operation
Provider plugin
Api
api1
Update
awscloudformation
Hosting
S3AndCloudFront
No Change
awscloudformation
Auth
auth1
No Change
awscloudformation
Api
api2
No Change
awscloudformation
Api
api3
No Change
awscloudformation
...
...
...
..
Function
function1
No Change
awscloudformation
Function
funciton2
No Change
awscloudformation
? Are you sure you want to continue? Yes
✖ An error occurred when pushing the resources to the cloud
methods.forEach is not a function
An error occurred during the push operation: methods.forEach is not a function
Expected behavior
No breakage occurs when amplify CLI upgrades
amplify push goes through
Reproduction steps
Current version 4.44.0
can still push with not issues via command line, but deployment fails if pushed to code commit repo and run via AWS Amplify infra.
Upgrade to 4.50.0 (or later)
run amplify push returns error `methods.forEach is not a function
GraphQL schema(s)
# Put schemas below this line
Log output
From console log:
2021-05-08T20:48:09.315Z [INFO]: �[0mTypeError: methods.forEach is not a function�[0m
�[0m at ApiGatewayAuthStack.createPoliciesFromResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:120:13)�[0m
�[0m at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:94:16�[0m
�[0m at Array.forEach (<anonymous>)�[0m
�[0m at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:84:31�[0m
�[0m at Array.forEach (<anonymous>)�[0m
�[0m at new ApiGatewayAuthStack (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:62:23)�[0m
�[0m at createApiGatewayAuthResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:201:17)�[0m
�[0m at Object.consolidateApiGatewayPolicies (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:197:10)�[0m
�[0m at Object.createEnvLevelConstructs (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/env-level-constructs.ts:22:5)�[0m
�[0m at runMicrotasks (<anonymous>)�[0m
�[0m at processTicksAndRejections (internal/process/task_queues.js:97:5)�[0m
�[0m at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:97:5)�[0m
Additional information
No response
The text was updated successfully, but these errors were encountered:
As you mentioned, there was a change in v4.50.0. The CLI now uses your API's api-params.json file to generate IAM policies. Would you mind sending that file to [email protected] and referencing this issue?
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v13.2.0
Amplify CLI Version
4.50.2
What operating system are you using?
Mac OS
Amplify Categories
auth, function, api, hosting
Amplify Commands
push
Describe the bug
Getting
methods.forEach is not a function
error onamplify push
since couple days (maybe week(s)).Could be related to fix delivered as part of 4.50.0 release.
Specifically
amplify-cli/packages/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts
Line 120 in fc77006
Since policy management has now changed, my templates probably missing data.
Current Environment: dev
methods.forEach is not a function
An error occurred during the push operation: methods.forEach is not a function
Expected behavior
amplify push
goes throughReproduction steps
amplify push
returns error `methods.forEach is not a functionGraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: