aws-amplify / aws-amplify/amplify-cli

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Open
#13,196 3 comments 0 reactions 0 assignees View on GitHub
bug custom-cdk p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

v18.16.0

### Amplify CLI Version

12.4.0

### 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 manual changes made

### Describe the bug

Building custom resources fails due to `heap limit allocation` error.

- I have 76 custom resources using `AWS CDK`
- `Amplify 11+` combined with `node 16+` fails with this error
- `Amplify 10.7.2` combined with `node 14` works fine
- All the resources are migrated to `AWS CDK v2`
- I've got `--max-old-space-size` set to 32 Gb
- Each of the custom resources build successfully if run separately.

As of right now I can not push resources to the cloud due to this error.

### Expected behavior

Custom resources' building successfully, therefore being able to run `amplify push`.

### Reproduction steps

1. Add ~80 custom resources using AWS CDK
2. run `amplify push` or `amplify build custom`

### Project Identifier

The command fails without an error descriptions

```
⠋ Sending zip

✖ Sending zip
```

### Log output

```
# Put your logs below this line
2023-09-07T16:55:29.681Z|info : amplify version core
2023-09-07T16:55:32.014Z|info : amplify help core
2023-09-07T16:55:43.996Z|info : amplify diagnose core {"send-report":true,"yes":false}
2023-09-07T16:55:44.063Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-09-07T16:56:43.925Z|info : amplify status core {"yes":false}
2023-09-07T16:56:43.990Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-09-07T16:57:06.001Z|info : amplify remove custom
2023-09-07T16:57:06.066Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-09-07T17:02:33.116Z|info : amplify diagnose core {"send-report":true,"yes":false}
2023-09-07T17:02:33.179Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-09-07T17:03:17.707Z|info : amplify diagnose core {"send-report":true,"debug":true,"yes":false}
2023-09-07T17:03:17.771Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}

```

### Additional information

_No response_

### Before submitting, please confirm:

- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.