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

Out of memory with Tailwind and new deps optimization #146

Closed
akaufmann opened this issue May 14, 2020 · 5 comments
Closed

Out of memory with Tailwind and new deps optimization #146

akaufmann opened this issue May 14, 2020 · 5 comments

Comments

@akaufmann
Copy link

akaufmann commented May 14, 2020

Describe the bug

The new dependency optimization in v0.15 makes v8 sweat and aborts with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory if you have Tailwind in your dependencies.

Reproduction

Add Tailwind v1.4.6 to your dependencies. Run vite.

System Info

  • required vite version: 0.15.2
  • required Operating System: macOS Catalina
  • required Node version: 13.7.0
  • Optional:
    • yarn version: 1.22.0

Logs (Optional if provided reproduction)

$ vite --debug
vite v0.15.2
  vite:resolve (node_module entry) tailwindcss -> tailwindcss/lib/index.js +0ms
  vite:resolve (node_module entry) vue -> vue/dist/vue.runtime.esm-bundler.js +1ms
[vite] Optimizable dependencies detected.
Pre-bundling them to speed up dev server page load...
  (this will be run only when your dependencies have changed)
(node:18974) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time

Fatal error:

$ vite
vite v0.15.2
[vite] Optimizable dependencies detected.
⠧ Pre-bundling them to speed up dev server page load...
  (this will be run only when your dependencies have changed)

<--- Last few GCs --->

[17342:0x102847000]   356786 ms: Scavenge 4029.8 (4176.4) -> 4015.4 (4178.9) MB, 14.2 / 0.0 ms  (average mu = 0.164, current mu = 0.095) allocation failure 
[17342:0x102847000]   356859 ms: Scavenge 4030.4 (4178.9) -> 4016.0 (4180.4) MB, 16.8 / 0.0 ms  (average mu = 0.164, current mu = 0.095) allocation failure 
[17342:0x102847000]   356929 ms: Scavenge 4031.0 (4180.4) -> 4016.5 (4181.9) MB, 13.8 / 0.0 ms  (average mu = 0.164, current mu = 0.095) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0xe50e7fcfc7d]
    1: StubFrame [pc: 0xe50e7fd0fea]
Security context: 0x0dacf311d9f1 <JSObject>
    2: loadNodeModules [0xdac78520d21] [/Users/akaufmann/devel/vuejs/test-vite/node_modules/resolve/lib/async.js:~291] [pc=0xe50e7ffe68a](this=0x0daca8884869 <JSGlobal Object>,0x0dac7851d891 <String[5]: path/>,0x0dac78520d89 <String[76]: /Users/akaufmann/devel/vuejs/test-vite/node_modules/tailwindcss/lib/lib>,0x0...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200514.205313.17342.0.001.json
Node.js report completed
 1: 0x100069fdc node::Abort() [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 2: 0x10006a72c node::errors::TryCatchScope::~TryCatchScope() [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 3: 0x1001b7127 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 4: 0x1001b70c4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 5: 0x1005bdd92 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 6: 0x1005c02c3 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 7: 0x1005bc7f8 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 8: 0x1005ba9b5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
 9: 0x1005c725c v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
10: 0x1005c72df v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
11: 0x1005964d4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
12: 0x100848d74 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/akaufmann/.nvm/versions/node/v13.7.0/bin/node]
13: 0xe50e7fcfc7d 
error Command failed with signal "SIGABRT".
@beetaa
Copy link

beetaa commented May 16, 2020

@yyx990803 when build with page using mdui,there's the same error shown like this:

image

@beetaa
Copy link

beetaa commented May 16, 2020

  • required vite version: 0.15.3
  • required Operating System: win10 2004 update, build in WSL2 ubuntu 18.04
  • required Node version: 13.9.0
  • NPM version: 6.13.7

@yyx990803
Copy link
Member

yyx990803 commented May 16, 2020

please don’t comment on closed issues. Open new ones with proper reproduction.

@andreif
Copy link

andreif commented Mar 2, 2021

I got same error with vite@2.0.4 and node v14.16.0 -- what should I do? Create a new issue or use some known solution?

@patak-dev
Copy link
Member

Please don't comment on old issues. Create a new issue for your problem including a minimal reproduction. Use https://chat.vitejs.dev in case you want to discuss before creating one

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants