🐛 Gatsby Build fails when there are lines with only whitespace #39136
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
The "Gatsby Build" job was failing when content repo had markdown file that contains lines with only whitespace.
Trimming those lines has resolved issue.
To mitigate this issue in the future we have implemented workaround which trims empty lines before building static pages - SSWConsulting/SSW.Rules#1519
The video that explains issue and resolution - https://youtu.be/tfoEjDFW-U0
Figure: Workflows were failing - https://github.com/SSWConsulting/SSW.Rules/actions/workflows/build-deploy-production.yml
Here's error message:
Error message as it will not be retained in the workflow runs
<--- Last few GCs --->
[2729:0x74ed2f0] 64642 ms: Mark-Compact 4055.1 (4134.3) -> 4040.0 (4135.1) MB, 2818.76 / 0.00 ms (average mu = 0.112, current mu = 0.010) allocation failure; scavenge might not succeed
[2729:0x74ed2f0] 68470 ms: Mark-Compact 4055.8 (4135.1) -> 4041.7 (4136.8) MB, 3799.23 / 0.00 ms (average mu = 0.055, current mu = 0.008) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0xb84bd6 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
2: 0xefead0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
3: 0xefedb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
4: 0x11107c5 [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
5: 0x1110d54 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
6: 0x1127c44 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
7: 0x112845c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
8: 0x10fe761 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
9: 0x10ff8f5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
10: 0x10dcf46 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
11: 0x1537cd6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/hostedtoolcache/node/20.12.0/x64/bin/node]
12: 0x7f0f886d9ef6
failed Building static HTML for pages - 143.621s
error Building static HTML failed
WebpackError:Worker exited before finishing task
Error: Process completed with exit code 1.
Reproduction Link
N/A
Steps to Reproduce
gatsby build
Expected Result
Gatsby Build handles whitespaces before generating new
Actual Result
gatsby build
fails due to whitespace which needs to be handled before generating pagesEnvironment
Config Flags
No response
The text was updated successfully, but these errors were encountered: