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

🐛 Gatsby Build fails when there are lines with only whitespace #39136

Open
2 tasks done
babakamyljanovssw opened this issue Oct 8, 2024 · 0 comments
Open
2 tasks done
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

Comments

@babakamyljanovssw
Copy link

babakamyljanovssw commented Oct 8, 2024

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

Image
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

  1. Have markdown file which has line that contains only whitespace
  2. Run gatsby build
  3. Check error when generating static pages

Expected Result

Gatsby Build handles whitespaces before generating new

Actual Result

gatsby build fails due to whitespace which needs to be handled before generating pages

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.0.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.11.5
  Browsers:
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    gatsby: 5.13.7 => 5.13.7
    gatsby-custom-md: ^1.3.0 => 1.3.0
    gatsby-plugin-algolia: ^1.0.3 => 1.0.3
    gatsby-plugin-breadcrumb: ^12.3.2 => 12.3.2
    gatsby-plugin-client-side-redirect: ^1.1.0 => 1.1.0
    gatsby-plugin-decap-cms: ^4.0.4 => 4.0.4
    gatsby-plugin-disqus: ^1.2.6 => 1.2.6
    gatsby-plugin-fontawesome-css: ^1.2.0 => 1.2.0
    gatsby-plugin-google-gtag: ^5.13.1 => 5.13.1
    gatsby-plugin-google-tagmanager: ^5.13.1 => 5.13.1
    gatsby-plugin-postcss: 6.13.1 => 6.13.1
    gatsby-plugin-react-helmet: ^6.13.1 => 6.13.1
    gatsby-plugin-sharp: ^5.13.1 => 5.13.1
    gatsby-plugin-sitemap: ^6.13.1 => 6.13.1
    gatsby-remark-autolink-headers: ^6.13.1 => 6.13.1
    gatsby-remark-copy-linked-files: ^6.13.1 => 6.13.1
    gatsby-remark-custom-blocks: ^3.15.0 => 3.15.0
    gatsby-remark-draw: ^1.0.16 => 1.0.16
    gatsby-remark-embed-video: ^3.2.1 => 3.2.1
    gatsby-remark-fenced-divs: ^1.0.3 => 1.0.3
    gatsby-remark-figure-caption: ^2.0.0 => 2.0.0
    gatsby-remark-images: ^7.13.2 => 7.13.1
    gatsby-remark-images-anywhere: ^1.3.1 => 1.3.1
    gatsby-remark-images-zoom: ^1.1.0 => 1.1.0
    gatsby-remark-relative-images-v2: ^0.1.5 => 0.1.5
    gatsby-remark-responsive-iframe: ^6.13.2 => 6.13.1
    gatsby-remark-vscode: ^3.3.1 => 3.3.1
    gatsby-source-filesystem: ^5.13.1 => 5.13.1
    gatsby-source-git: ^1.1.0 => 1.1.0
    gatsby-source-local-git: ^1.3.0 => 1.3.0
    gatsby-transformer-json: ^5.13.1 => 5.13.1
    gatsby-transformer-remark: 3.2.0 => 3.2.0
    gatsby-transformer-sharp: ^5.13.1 => 5.13.1
  npmGlobalPackages:
    gatsby-cli: 5.13.3

Config Flags

No response

@babakamyljanovssw babakamyljanovssw added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 8, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants
@babakamyljanovssw and others