vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.03k stars 2.1k forks source link

Some chunks are larger than 500 kBs after minification #2870

Closed ezzle closed 10 months ago

ezzle commented 1 year ago

Describe the bug

Build terminated :

How to resolde this issue ?

npm run docs:dev successfully

But build failed !

` npm run docs:build

docs:build vitepress build docs

vitepress v1.0.0-rc.10

⠦ building client + server bundles... (!) Some chunks are larger than 500 kBs after minification. Consider:

Reproduction

Very large site : +500K files npm run docs:build

Expected behavior

Build success

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (4) x64 AMD EPYC 7763 64-Core Processor
    Memory: 13.75 GB / 15.62 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 20.5.1 - ~/nvm/current/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.8.0 - ~/nvm/current/bin/npm
    pnpm: 8.6.12 - ~/nvm/current/bin/pnpm
  npmPackages:
    vitepress: v1.0.0-rc.10 => 1.0.0-rc.10

Additional context

No response

Validations

brc-dd commented 1 year ago

Try with something like NODE_OPTIONS=--max-old-space-size=8192 npm run docs:build

ezzle commented 1 year ago

NODE_OPTIONS=--max_old_space_size=102400 npm run docs:build

docs:build vitepress build docs

vitepress v1.0.0-rc.10

⠇ building client + server bundles... (!) Some chunks are larger than 500 kBs after minification. Consider:

[14008:0x554afc0] 634168 ms: Scavenge 16013.3 (19459.7) -> 16011.8 (19459.7) MB, 22.30 / 0.00 ms (average mu = 0.096, current mu = 0.000) external memory pressure;

<--- JS stacktrace --->

FATAL ERROR: NewSpace::EnsureCurrentCapacity Allocation failed - JavaScript heap out of memory 1: 0xc98550 node::Abort() [node] 2: 0xb700a7 [node] 3: 0xebae80 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [node] 4: 0xebb167 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [node] 5: 0x10cc7d5 [node] 6: 0x110bae9 [node] 7: 0x10de926 v8::internal::Heap::MarkCompact() [node] 8: 0x10e3f7d v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const) [node] 9: 0x10e446c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 10: 0x10e646f v8::internal::Heap::AllocateExternalBackingStore(std::function<void (unsigned long)> const&, unsigned long) [node] 11: 0x1238942 v8::internal::BackingStore::Allocate(v8::internal::Isolate, unsigned long, v8::internal::SharedFlag, v8::internal::InitializedFlag) [node] 12: 0xecfbe3 v8::ArrayBuffer::NewBackingStore(v8::Isolate, unsigned long) [node] 13: 0xc682a4 node::Buffer::New(v8::Isolate*, v8::Local, node::encoding) [node] 14: 0xc686ea [node] 15: 0x7f1233e4d546 Aborted (core dumped)

brc-dd commented 1 year ago

Ah, don't think we would be able to fix this then. This has been reported earlier too, and I think that it's probably related to https://github.com/vitejs/vite/issues/2433. However, it's still possible that there might be a memory leak here. Contributions are welcome if someone can figure out if this is not an upstream issue. If you have too big sites, I'd suggest using some other tool instead.

changweihua commented 1 year ago

check if any other npm packages such as mermaid installed recently

ezzle commented 1 year ago

Mermaid + vue-Mermaid-string

Le jeu. 31 août 2023, 15:56, changweihua @.***> a écrit :

check if any other npm packages such as mermaid installed recently

— Reply to this email directly, view it on GitHub https://github.com/vuejs/vitepress/issues/2870#issuecomment-1701087559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALX32WJN3SBZUD256BPAGY3XYCJXVANCNFSM6AAAAAA4CAZXZM . You are receiving this because you authored the thread.Message ID: @.***>

ezzle commented 1 year ago

check if any other npm packages such as mermaid installed recently

@changweihua : any news ? What did you mean ?

Best regards,

Tshitshi

brc-dd commented 10 months ago

fixed the memory issue in #3366

that minification related warnings will still be there, those are because of mermaid -- mermaid is not properly treeshakable and is a huge library. you can adjust settings to supress the warning, but it won't fix it.