Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify Configure Codegen FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #842

Closed
4 tasks done
dan-codes1 opened this issue May 13, 2024 · 3 comments

Comments

@dan-codes1
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • 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?

brew

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

21.7.3

Amplify CLI Version

12.12.0

What operating system are you using?

Mac

Amplify Codegen Command

codegen add, codegen configure

Describe the bug

Hello,

Anytime I run amplify add codegen or amplify configure codegen I get an error: "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory"

This is the error log:
danieleze@Daniels-MacBook-Pro-3 xploree-ios % amplify configure codegen
? Enter the file name pattern of graphql queries, mutations and subscriptions gr
aphql/**/*.graphql
? Do you want to generate/update all possible GraphQL operations - queries, muta
tions and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply
nested] 10
? Enter the file name for the generated code API.swift
? Do you want to generate code for your newly created GraphQL API Yes
✔ Generated GraphQL operations successfully and saved at graphql
⠋ Generating
<--- Last few GCs --->

[69303:0x7f81e8040000] 178399 ms: Mark-sweep 4035.0 (4137.7) -> 4022.1 (4140.9) MB, 2154.2 / 0.0 ms (average mu = 0.167, current mu = 0.018) allocation failure; scavenge might not succeed
[69303:0x7f81e8040000] 181888 ms: Mark-sweep 4038.2 (4140.9) -> 4025.4 (4144.2) MB, 3445.5 / 0.0 ms (average mu = 0.073, current mu = 0.012) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x10310a505 node::Abort() [/Users/danieleze/.amplify/bin/amplify]
2: 0x10310c414 node::OOMErrorHandler(char const*, bool) [/Users/danieleze/.amplify/bin/amplify]
3: 0x1032ee0c0 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/danieleze/.amplify/bin/amplify]
4: 0x103535a05 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/danieleze/.amplify/bin/amplify]
5: 0x103533ca1 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/danieleze/.amplify/bin/amplify]
6: 0x1035227cc v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/danieleze/.amplify/bin/amplify]
7: 0x1035236b4 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/danieleze/.amplify/bin/amplify]
8: 0x1034ff6bf v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/danieleze/.amplify/bin/amplify]
9: 0x1039e6c83 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/danieleze/.amplify/bin/amplify]
10: 0x102e9ec79 [/Users/danieleze/.amplify/bin/amplify]

Expected behavior

Generate codegen code

Reproduction steps

  1. Add graphql to your amplify project
  2. Dont add codegen on the first prompt
  3. Run amplify push
  4. Then try amplify configure codegen or amplify add codegen

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@dan-codes1 dan-codes1 changed the title Amplify Configure Codegen Error Amplify Configure Codegen FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory May 13, 2024
@phani-srikar
Copy link
Contributor

Hi @dan-codes1, I suspect if there's anything in your schema definition that's causing the codegen process (types generation) to run out of memory. Please run amplify diagnose --send-report and share the project identifier that gets generated, so we can take try to reproduce with your schema.

@AnilMaktala
Copy link
Member

Hey 👋 , This issue is being closed due to inactivity. If you are still experiencing the same problem and need further assistance, please feel free to leave a comment. This will enable us to reopen the issue and provide you with the necessary support.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants