vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.17k stars 923 forks source link

[Bug report] build fail when run vuepress build docs #1297

Closed yamsfeer closed 1 year ago

yamsfeer commented 1 year ago

Description

Compiling with vite <--- Last few GCs --->

[12287:0x7fc62092b000] 60958 ms: Scavenge 2010.3 (2082.5) -> 2005.5 (2084.0) MB, 7.4 / 0.0 ms (average mu = 0.807, current mu = 0.719) allocation failure; [12287:0x7fc62092b000] 60991 ms: Scavenge 2012.3 (2084.3) -> 2007.9 (2085.8) MB, 18.8 / 0.0 ms (average mu = 0.807, current mu = 0.719) allocation failure; [12287:0x7fc62092b000] 61168 ms: Scavenge 2015.1 (2086.3) -> 2009.8 (2103.0) MB, 121.8 / 0.0 ms (average mu = 0.807, current mu = 0.719) allocation failure;

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 1: 0x10f0104a5 node::Abort() [/usr/local/bin/node] 2: 0x10f010628 node::OnFatalError(char const, char const) [/usr/local/bin/node] 3: 0x10f17da61 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/usr/local/bin/node] 4: 0x10f341f75 v8::internal::Heap::FatalProcessOutOfMemory(char const) [/usr/local/bin/node] 5: 0x10f340810 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node] 6: 0x10f33268a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node] 7: 0x10f333025 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node] 8: 0x10f3158ee v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node] 9: 0x10f73faa6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate*) [/usr/local/bin/node] 10: 0x10fb325b9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node] 11: 0x1157b9c46 12: 0x11516a9b4 /var/folders/g0/6j5xls1n2h57p607xdtl8__40000gn/T/build-8ae194d0.sh: line 1: 12287 Abort trap: 6 vuepress build docs

Reproduction

none

Used Package Manager

pnpm

System Info

System:
    OS: macOS 13.2.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 126.03 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm
  Utilities:
    Git: 2.30.1 - /usr/bin/git
  Browsers:
    Chrome: 111.0.5563.64
    Edge: Not Found
    Firefox: Not Found
    Safari: 16.3
  npmPackages:
    @vuepress/bundler-vite: Not Found
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli: Not Found
    @vuepress/client: 2.0.0-beta.61 => 2.0.0-beta.61 
    @vuepress/core: Not Found
    @vuepress/markdown: Not Found
    @vuepress/plugin-active-header-links: Not Found
    @vuepress/plugin-back-to-top: Not Found
    @vuepress/plugin-container: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon: Not Found
    @vuepress/plugin-git: Not Found
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom: Not Found
    @vuepress/plugin-nprogress: Not Found
    @vuepress/plugin-palette: Not Found
    @vuepress/plugin-prismjs: Not Found
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data: Not Found
    @vuepress/plugin-toc: Not Found
    @vuepress/shared: Not Found
    @vuepress/theme-default: Not Found
    @vuepress/utils: Not Found
    vue: ^3.2.36 => 3.2.36 
    vue-loader: Not Found
    vue-router: Not Found
    vuepress: 2.0.0-beta.61 => 2.0.0-beta.61 
    vuepress-vite: Not Found
    vuepress-webpack: Not Found
yamsfeer commented 1 year ago

The error is caused by node's memory limit, and can be solved by extending this limit.

node --max-old-space-size=4096 yourscript.js
# or
export NODE_OPTIONS=--max_old_space_size=4096