I'm getting a heap limit error when attempting to build this project. This is on an M1 macOS laptop with 64GB of memory.
yarn run v1.22.19
$ next build
- info Linting and checking validity of types ...- warn The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
- info Linting and checking validity of types ..
<--- Last few GCs --->
[22365:0x140040000] 29725 ms: Mark-sweep 4044.7 (4133.4) -> 4037.0 (4143.0) MB, 576.9 / 0.1 ms (average mu = 0.787, current mu = 0.250) allocation failure; scavenge might not succeed
[22365:0x140040000] 30985 ms: Mark-sweep 4053.1 (4143.0) -> 4044.9 (4149.7) MB, 1212.1 / 0.2 ms (average mu = 0.477, current mu = 0.038) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x1007894fc node::Abort() [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
2: 0x1007896ec node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
3: 0x1008df0fc v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
4: 0x100a8a088 v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
5: 0x100a88b6c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
6: 0x100a7ce14 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/nod
7: 0x100a7d644 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/no
8: 0x100a63478 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
9: 0x100df32bc v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
10: 0x10113d04c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
11: 0x1010ca2d0 Builtins_GrowFastSmiOrObjectElements [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
12: 0x10a8b0ca0
13: 0x10793b418
14: 0x105e63910
15: 0x106677d28
16: 0x10792a180
17: 0x105f38f50
18: 0x105e6f140
19: 0x107908f60
20: 0x10791cbb0
21: 0x105f3224c
22: 0x105e54724
23: 0x1066b73e0
24: 0x107925d0c
25: 0x105e4a934
26: 0x10c53b6e8
27: 0x105f17568
28: 0x105e62370
29: 0x10a8891a8
30: 0x105f2512c
31: 0x105d0dfd4
32: 0x10a8ca370
33: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
34: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
35: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
36: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
37: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
38: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
39: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
40: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
41: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
42: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
43: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
44: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
45: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
46: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
47: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
48: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
49: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
50: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
51: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
52: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
53: 0x1010c8198 Builtins_InterpreterEntryTrampoline [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
54: 0x1010f9ef4 Builtins_AsyncFunctionAwaitResolveClosure [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
55: 0x101188738 Builtins_PromiseFulfillReactionJob [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
56: 0x1010ebc4c Builtins_RunMicrotasks [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
57: 0x1010c63a4 Builtins_JSRunMicrotasksEntry [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
58: 0x100a0b82c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
59: 0x100a0bd1c v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
60: 0x100a0bef8 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
61: 0x100a32644 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
62: 0x100a32edc v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
63: 0x1006d8c50 node::InternalCallbackScope::Close() [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
64: 0x1006d87c4 node::InternalCallbackScope::~InternalCallbackScope() [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
65: 0x100784964 node::fs::FSReqPromise<node::AliasedBufferBase<double, v8::Float64Array, void>>::Resolve(v8::Local<v8::Value>) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
66: 0x10078fcd4 node::fs::AfterStringPtr(uv_fs_s*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
67: 0x100785330 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
68: 0x1010a5058 uv__work_done [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
69: 0x1010a8800 uv__async_io [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
70: 0x1010bafa4 uv__io_poll [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
71: 0x1010a8cd0 uv_run [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
72: 0x1006d96f4 node::SpinEventLoop(node::Environment*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
73: 0x1007c68ec node::NodeMainInstance::Run() [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
74: 0x100756028 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
75: 0x1007562b4 node::Start(int, char**) [/Users/thomas.hunter/.nvm/versions/node/v18.16.0/bin/node]
76: 0x1abc0ff28 start [/usr/lib/dyld]