Description
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
- Add graphql to your amplify project
- Dont add codegen on the first prompt
- Run
amplify push
- Then try
amplify configure codegen
oramplify add codegen
GraphQL schema(s)
# Put schemas below this line
Log output
# Put your logs below this line
Additional information
No response