Compiler fails on local environment - JavaScript heap out of memory
See original GitHub issueWhat version of Next.js are you using?
12.0.1
What version of Node.js are you using?
17.0.1
What browser are you using?
Chrome, latest
What operating system are you using?
Mac
How are you deploying your application?
next start
Describe the Bug
Basically in the title. When I upgraded to the new Next.js version, when I try to load any page on localhost, the following stack trace occurs. I tried this with node from nvm, version 14, 16 and 17.
Worth noting I am working on a M1 13 inch MacbookPro.
Stack trace:
<--- Last few GCs --->
[9544:0x158008000] 43409 ms: Mark-sweep 4046.3 (4134.4) -> 4039.7 (4131.9) MB, 6989.3 / 0.0 ms (average mu = 0.204, current mu = 0.009) allocation failure scavenge might not succeed
[9544:0x158008000] 51017 ms: Mark-sweep 4055.5 (4131.9) -> 4051.0 (4154.9) MB, 7595.2 / 0.0 ms (average mu = 0.097, current mu = 0.002) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x102dd81a0 node::Abort() [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
2: 0x102dd8328 node::errors::TryCatchScope::~TryCatchScope() [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
3: 0x102f23940 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
4: 0x102f238d4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
5: 0x1030a4fc8 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
6: 0x1030a3ad4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
7: 0x1030aebec v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
8: 0x1030aec80 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
9: 0x103081d5c v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
10: 0x1033be144 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
11: 0x1036d024c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
12: 0x1088aa1b0
13: 0x1088a9df4
14: 0x1088a9c98
15: 0x1088a9c98
16: 0x1088a9c98
17: 0x1088a9df4
18: 0x1088a9c98
19: 0x1088a9df4
20: 0x1088a9df4
21: 0x1088a9df4
22: 0x1088a9c98
23: 0x1088a9df4
24: 0x1088a9c98
25: 0x1088a9c98
26: 0x1088a9df4
27: 0x1088a9df4
28: 0x1088a9df4
29: 0x1088a9c98
30: 0x1088a9c98
31: 0x1088a9c98
32: 0x108448f48
33: 0x10844875c
34: 0x103716830 Builtins_PromiseConstructor [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
35: 0x103661f10 Builtins_JSBuiltinsConstructStub [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
36: 0x108472ec0
37: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
38: 0x108448b54
39: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
40: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
41: 0x10872e9e8
42: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
43: 0x108448b54
44: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
45: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
46: 0x10872e9e8
47: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
48: 0x108448b54
49: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
50: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
51: 0x10872e9e8
52: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
53: 0x108448b54
54: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
55: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
56: 0x10872e9e8
57: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
58: 0x108448b54
59: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
60: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
61: 0x10872e9e8
62: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
63: 0x108448b54
64: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
65: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
66: 0x10872e9e8
67: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
68: 0x108448b54
69: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
70: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
71: 0x10872e9e8
72: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
73: 0x108448b54
74: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
75: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
76: 0x10872e9e8
77: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
78: 0x108448b54
79: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
80: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
81: 0x10872e9e8
82: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
83: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
84: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
85: 0x107db0dac
86: 0x107ab53bc
87: 0x107dc9214
88: 0x10845de30
89: 0x107a9f49c
90: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
91: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
92: 0x103664cd8 Builtins_InterpreterEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
93: 0x103693394 Builtins_AsyncFunctionAwaitRejectClosure [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
94: 0x103718418 Builtins_PromiseRejectReactionJob [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
95: 0x103685978 Builtins_RunMicrotasks [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
96: 0x1036629a4 Builtins_JSRunMicrotasksEntry [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
97: 0x103031014 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
98: 0x103031448 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
99: 0x103031510 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
100: 0x103054654 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
101: 0x103054ee8 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
102: 0x103666694 Builtins_CallApiCallback [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
103: 0x1084f2b9c
104: 0x103662acc Builtins_JSEntryTrampoline [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
105: 0x103662764 Builtins_JSEntry [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
106: 0x10303104c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
107: 0x1030306e0 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
108: 0x102f402d8 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
109: 0x102d27e40 node::InternalCallbackScope::Close() [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
110: 0x102d2836c node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
111: 0x102d3d46c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
112: 0x102ddc484 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
113: 0x102ddcbdc node::fs::AfterNoArgs(uv_fs_s*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
114: 0x1036422bc uv__work_done [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
115: 0x103645a1c uv__async_io [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
116: 0x103657730 uv__io_poll [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
117: 0x103645eac uv_run [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
118: 0x102d28e00 node::SpinEventLoop(node::Environment*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
119: 0x102e112a8 node::NodeMainInstance::Run(int*, node::Environment*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
120: 0x102e10f74 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
121: 0x102daa31c node::Start(int, char**) [/Users/antoninwingender/.nvm/versions/node/v17.0.1/bin/node]
122: 0x187e55450 start [/usr/lib/system/libdyld.dylib]
Expected Behavior
Page loading as standard.
To Reproduce
Not sure. Try to load a Next js page on my configuration?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:11 (3 by maintainers)
Top Results From Across the Web
How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
Open the Start menu, search for Advanced System Settings, and select the Best match. · From the dialog box, click on Environment Variables,...
Read more >JavaScript Heap Out Of Memory Error - OpenReplay Blog
A quick solution that you can use to fix "Heap Out Of Memory Error" in JavaScript. We lay out the causes and how...
Read more >Node.js heap out of memory - javascript - Stack Overflow
If you want to increase the memory usage of the node globally - not only single script, you can export environment variable, like...
Read more >How to solve JavaScript heap out of memory error
To fix JavaScript heap out of memory error, you need to add the --max-old-space-size option when running your npm command. Here's an example...
Read more >JavaScript heap out of memory after upgrading to 4.3 #44299
2 I get a "JavaScript heap out of memory" exception when i try to run tsc . Downgrading to 4.2.4 does not yield...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Could be a duplicate of #30330
see comment https://github.com/vercel/next.js/issues/30330#issuecomment-952172377 to see if that works
@benjipott then it’s likely something else than this particular issue. Please open a new issue with a reproduction so that we can investigate it 👍