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

Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #66

Closed
naralasaimanoj opened this issue Aug 2, 2019 · 93 comments

Comments

@naralasaimanoj
Copy link

Getting this error continously after upgrading the package to 1.4.1. No issues were observed in 1.3.0

applySourceMap.js file was added recently. what is going wrong here ?

<--- JS stacktrace --->

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

0: ExitFrame [pc: 0xb41561dbe1d]
1: StubFrame [pc: 0xb41561a0573]

Security context: 0x353fb8d9e6e9
2: /* anonymous /(aka / anonymous */) [0x115ab165d461] [/node_modules/webpack-sources/lib/applySourceMap.js:~58] [pc=0xb41578f5e0d](this=0x2729fd7826f1 ,c...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x8dc510 node::Abort() [node]
2: 0x8dc55c [node]
3: 0xad9b5e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xad9d94 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xec7bf2 [node]
6: 0xec7cf8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
7: 0xed3dd2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xed4704 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xed7371 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xea6fbb v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
11: 0xff08b3 v8::internal::String::SlowFlatten(v8::internal::Handlev8::internal::ConsString, v8::internal::PretenureFlag) [node]
12: 0xad7184 v8::internal::String::Flatten(v8::internal::Handlev8::internal::String, v8::internal::PretenureFlag) [node]
13: 0xff1a1e v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handlev8::internal::String) [node]
14: 0x1169f18 v8::internal::Runtime_HasProperty(int, v8::internal::Object**, v8::internal::Isolate*) [node]
15: 0xb41561dbe1d
npm ERR! code ELIFECYCLE

@alexander-akait
Copy link
Member

@naralasaimanoj please create minimum reproducible test repo

@SkReD
Copy link

SkReD commented Aug 20, 2019

Also encountered similar problem in project with a lot of async chunks. In my case build just doesnt finishing. Manually installing 1.3.0 version fixes build. Reproducible repo would be hard to build, because when reducing number of async modules by half or so the build is finishing. Looks like big numder of async modules is required. Try my best

@alexander-akait
Copy link
Member

Somebody can create minimum reproducible test repo otherwise issue will be closed

@7rulnik
Copy link

7rulnik commented Sep 16, 2019

Seems that problem reproduces only with node@10. I tried it with node@12 — all works

@alexander-akait
Copy link
Member

@7rulnik What is node@10? Latest?

@7rulnik
Copy link

7rulnik commented Sep 25, 2019

@evilebottnawi major version of node. So on 10.x.x it doesn't work

@alexander-akait
Copy link
Member

@7rulnik can you provde reproducible test repo with instructions?

@7rulnik
Copy link

7rulnik commented Sep 25, 2019

Unfortunately, I can't. It's not so easy. I have about ~100 chunks and node target.

@alexander-akait
Copy link
Member

@7rulnik maybe you can provide access to private project (email: sheo13666q @ gmail.com)? if necessary I can sign an NDA, reproducible test repo allow us to solve problem more fast

@7rulnik
Copy link

7rulnik commented Sep 27, 2019

@evilebottnawi sorry, but I believe it's not possible because I'm working in the bank and we have really strong security rules.

So the main idea that you should have a lot of dynamic imports (in our case it's about 120). Maybe you can give me advice how to debug it?

Also, I can provide snapshots from Chrome devtool like in this article
https://tech.residebrokerage.com/debugging-node-js-memory-problems-d450787d9253

@alexander-akait
Copy link
Member

@7rulnik any additional information will be great

@vankop
Copy link
Member

vankop commented Sep 28, 2019

@7rulnik if it is memory leak, heap snapshot will be very useful, i can take a look on it if you will provide it and webpack version.
If problem is common to server environment (e.g. docker, kubernetes or another remote server). I can suggest to use https://github.com/sfninja/thetool to make sampling. (created by ndb author)

@vankop
Copy link
Member

vankop commented Sep 28, 2019

I can just make +1 on this problem. We faced with same problem (same a lot of async chunks). However, we have just increased max old space size.

Unfortunately, I don't work on that project now and can not help with investigation.

@7rulnik
Copy link

7rulnik commented Oct 2, 2019

@evilebottnawi @vankop hey guys

I tried to make a repro — no luck here. Also, I tried to capture heap snapshots via inspect API — no luck here too. My mac just stuck when I was trying to capture it.

But I did some research about node.

So on node v12.0.0 I got this message:

#
# Fatal error in , line 0
# Check failed: U_SUCCESS(status).
#
#
#
#FailureMessage Object: 0x7ffeefbf3c00node process exited with code null

It's different but seems that it's related to node internals.

After that, I tried it with node v12.1.0 and it worked out.
Seems that there were introduced some GC related optimizations according to changelog.

Also I noticed that it crashes on
93% after chunk asset optimization SourceMapDevToolPlugin server.js generate SourceMap
It's biggest chunk in my app. And also it's entrypoint. In my case server.js is 7.8mb and server.js.map 23.5mb. So they are huge.

@7rulnik
Copy link

7rulnik commented Oct 2, 2019

Finally, I managed how to make repro.
https://github.com/7rulnik/webpack-sources-leak-repro
it's private. I added @evilebottnawi @vankop and @sokra as collaborators

@vankop
Copy link
Member

vankop commented Oct 2, 2019

At first look looks like generating source maps for ConcatSource with more than 4k children (strings, ConcatSource, ReplaceSource ) takes extremely too much resources.

I will take a deep look later.

UPD:
heap size before SourceNode generation 650MB, after 1300MB. After starting traversing tree getting out of memory crash for default max old space (1400-1500MB)

Is it ok for code {a: 1, b: 2} to generate SourceNodes something like:

node: "{"
node: "a"
node: ":"
node: " "
node: "1"
node: ", "
node: "b"
node: ":"
node: " "
node: "2"
node: "}"

It looks like it could be one to one mapping here + it could be small optimization for ConcatSource concatenate all string sources between two Sources together

@sokra
Copy link
Member

sokra commented Oct 2, 2019

I was not able to see the problem in your repo @7rulnik

It runs fine, it even generates smaller SourceMaps files with 1.4.1 compared to 1.3.0.

I tried with node 10.15.3 and 12.8.0


Is it ok for code {a: 1, b: 2} to generate SourceNodes something like:

Totally possible, each node probably points to a different location in the original source code.

@7rulnik
Copy link

7rulnik commented Oct 2, 2019

@sokra it's strange. Try to increase page's count?
@vankop Did it crash for you?

@vankop
Copy link
Member

vankop commented Oct 2, 2019

Yes it crashes for me, I'm getting out of memory for default max old space size. I have pointed where it happens

heap size before SourceNode generation 650MB, after 1300MB. After starting traversing tree getting out of memory crash for default max old space (1400-1500MB)

but I don't know how to help you 😞 it looks like source mapping just cost a lot of RAM =( @sokra @evilebottnawi @7rulnik I can upload for you heap snapshots (before source nodes creation, after, after starting traversing source nodes and generating source map) if you want to.

I have Node.js 11.13.0

@alexander-akait
Copy link
Member

alexander-akait commented Oct 2, 2019

Is it happens only on node@11? I recommend try to avoid using non stable (non LTS) versions of node, sometimes they have perf/memory regressions in non LTS release (sometimes in LTS too :trollface: )

@vankop
Copy link
Member

vankop commented Oct 2, 2019

Ok I will try to run in Node.js 12 in docker (So it totally will not depend on environment) later evening today.

@sokra
Copy link
Member

sokra commented Oct 2, 2019

I'm running on windows, maybe this is a OSX or linux only issue?

@7rulnik
Copy link

7rulnik commented Oct 2, 2019

@evilebottnawi it happens from 10.0.0 to 12.0.0 and fixed in 12.1.0 on macOS@10.14.6
I can try to run it on windows too

@sitesfaction
Copy link

sitesfaction commented Oct 2, 2019

win 10, node 10.15.3
it's all ok
repo

terminal log
$ ./node_modules/.bin/webpack --progress
Hash: ab7f5ae7efa07828daf1
Version: webpack 4.41.0
Time: 73008ms
Built at: 2019-10-02 18:56:43
      Asset      Size  Chunks                   Chunk Names
    main.js    10 MiB       0  [emitted]        main
main.js.map  37.5 MiB       0  [emitted] [dev]  main
Entrypoint main = main.js main.js.map
 [0] ./src/index.js 45 bytes {0} [built]
 [1] ./src/pages lazy ^\.\/.*\/index\.jsx$ namespace object 160 bytes {0} [built]
 [2] ./src/pages/__100_days — копия/desktop/index.jsx + 16 modules 256 KiB {0} [optional] [built]
     | ./src/pages/__100_days — копия/desktop/index.jsx 16.2 KiB [optional] [built]
     | ./src/pages/__100_days — копия/desktop/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days — копия/desktop/header-desktop-ru.jsx 8.28 KiB [built]
     | ./src/pages/__100_days — копия/desktop/breadcrumbs-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days — копия/desktop/card-benefits-ru.jsx 24.8 KiB [built]
     | ./src/pages/__100_days — копия/desktop/navigation-ru.jsx 3.26 KiB [built]
     | ./src/pages/__100_days — копия/desktop/steps-ru.jsx 4.42 KiB [built]
     | ./src/pages/__100_days — копия/desktop/refinance-ru.jsx 5.46 KiB [built]
     | ./src/pages/__100_days — копия/desktop/advantages-ru.jsx 9.45 KiB [built]
     | ./src/pages/__100_days — копия/desktop/grace-period-ru.jsx 14.4 KiB [built]
     | ./src/pages/__100_days — копия/desktop/required-documents-ru.jsx 1.29 KiB [built]
     | ./src/pages/__100_days — копия/desktop/feedbacks-ru.jsx 2.67 KiB [built]
     | ./src/pages/__100_days — копия/desktop/good-to-know-ru.jsx 141 KiB [built]
     | ./src/pages/__100_days — копия/desktop/anketa-ru.jsx 12.8 KiB [built]
     | ./src/pages/__100_days — копия/desktop/widget-footer-desktop-v-2-ru.jsx 5.59 KiB [built]
     |     + 2 hidden modules
 [3] ./src/pages/__100_days/desktop/index.jsx + 16 modules 256 KiB {0} [optional] [built]
     | ./src/pages/__100_days/desktop/index.jsx 16.2 KiB [optional] [built]
     | ./src/pages/__100_days/desktop/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days/desktop/header-desktop-ru.jsx 8.28 KiB [built]
     | ./src/pages/__100_days/desktop/breadcrumbs-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days/desktop/card-benefits-ru.jsx 24.8 KiB [built]
     | ./src/pages/__100_days/desktop/navigation-ru.jsx 3.26 KiB [built]
     | ./src/pages/__100_days/desktop/steps-ru.jsx 4.42 KiB [built]
     | ./src/pages/__100_days/desktop/refinance-ru.jsx 5.46 KiB [built]
     | ./src/pages/__100_days/desktop/advantages-ru.jsx 9.45 KiB [built]
     | ./src/pages/__100_days/desktop/grace-period-ru.jsx 14.4 KiB [built]
     | ./src/pages/__100_days/desktop/required-documents-ru.jsx 1.29 KiB [built]
     | ./src/pages/__100_days/desktop/feedbacks-ru.jsx 2.67 KiB [built]
     | ./src/pages/__100_days/desktop/good-to-know-ru.jsx 141 KiB [built]
     | ./src/pages/__100_days/desktop/anketa-ru.jsx 12.8 KiB [built]
     | ./src/pages/__100_days/desktop/widget-footer-desktop-v-2-ru.jsx 5.59 KiB [built]
     |     + 2 hidden modules
 [4] ./src/pages/__100_days_ab — копия/desktop/index.jsx + 15 modules 238 KiB {0} [optional] [built]
     | ./src/pages/__100_days_ab — копия/desktop/index.jsx 12.3 KiB [optional] [built]
     | ./src/pages/__100_days_ab — копия/desktop/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/header-desktop-ru.jsx 8 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/breadcrumbs-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/card-benefits-ru.jsx 16.2 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/navigation-ru.jsx 2.06 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/advantages-ru.jsx 9.29 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/grace-period-ru.jsx 14.4 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/refinance-ru.jsx 5.12 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/required-documents-ru.jsx 1.81 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/how-to-get-card-ru.jsx 4.55 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/anketa-ru.jsx 12.5 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/good-to-know-ru.jsx 140 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/widget-footer-desktop-v-2-ru.jsx 5.57 KiB [built]
     | ./src/pages/__100_days_ab — копия/desktop/agreement-popup-desktop-ru.jsx 1.14 KiB [built]
     |     + 1 hidden module
 [5] ./src/pages/__100_days_ab/desktop/index.jsx + 15 modules 238 KiB {0} [optional] [built]
     | ./src/pages/__100_days_ab/desktop/index.jsx 12.3 KiB [optional] [built]
     | ./src/pages/__100_days_ab/desktop/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days_ab/desktop/header-desktop-ru.jsx 8 KiB [built]
     | ./src/pages/__100_days_ab/desktop/breadcrumbs-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days_ab/desktop/card-benefits-ru.jsx 16.2 KiB [built]
     | ./src/pages/__100_days_ab/desktop/navigation-ru.jsx 2.06 KiB [built]
     | ./src/pages/__100_days_ab/desktop/advantages-ru.jsx 9.29 KiB [built]
     | ./src/pages/__100_days_ab/desktop/grace-period-ru.jsx 14.4 KiB [built]
     | ./src/pages/__100_days_ab/desktop/refinance-ru.jsx 5.12 KiB [built]
     | ./src/pages/__100_days_ab/desktop/required-documents-ru.jsx 1.81 KiB [built]
     | ./src/pages/__100_days_ab/desktop/how-to-get-card-ru.jsx 4.55 KiB [built]
     | ./src/pages/__100_days_ab/desktop/anketa-ru.jsx 12.5 KiB [built]
     | ./src/pages/__100_days_ab/desktop/good-to-know-ru.jsx 140 KiB [built]
     | ./src/pages/__100_days_ab/desktop/widget-footer-desktop-v-2-ru.jsx 5.57 KiB [built]
     | ./src/pages/__100_days_ab/desktop/agreement-popup-desktop-ru.jsx 1.14 KiB [built]
     |     + 1 hidden module
 [6] ./src/pages/__100_days/mobile/index.jsx + 14 modules 232 KiB {0} [optional] [built]
     | ./src/pages/__100_days/mobile/index.jsx 25.6 KiB [optional] [built]
     | ./src/pages/__100_days/mobile/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__100_days/mobile/header-mobile-ru.jsx 3.84 KiB [built]
     | ./src/pages/__100_days/mobile/navigation-ru.jsx 3.41 KiB [built]
     | ./src/pages/__100_days/mobile/steps-ru.jsx 3.55 KiB [built]
     | ./src/pages/__100_days/mobile/advantages-ru.jsx 8.28 KiB [built]
     | ./src/pages/__100_days/mobile/grace-period-ru.jsx 9.84 KiB [built]
     | ./src/pages/__100_days/mobile/refinance-ru.jsx 4.89 KiB [built]
     | ./src/pages/__100_days/mobile/required-documents-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days/mobile/feedbacks-ru.jsx 2.68 KiB [built]
     | ./src/pages/__100_days/mobile/good-to-know-ru.jsx 147 KiB [built]
     | ./src/pages/__100_days/mobile/anketa-ru.jsx 11.9 KiB [built]
     | ./src/pages/__100_days/mobile/footer-mobile-ru.jsx 5.53 KiB [built]
     | ./src/pages/__100_days/mobile/seo-cities-ru.jsx 1.15 KiB [built]
 [7] ./src/pages/__100_days — копия/mobile/index.jsx + 14 modules 232 KiB {0} [optional] [built]
     | ./src/pages/__100_days — копия/mobile/index.jsx 25.6 KiB [optional] [built]
     | ./src/pages/__100_days — копия/mobile/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days — копия/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__100_days — копия/mobile/header-mobile-ru.jsx 3.84 KiB [built]
     | ./src/pages/__100_days — копия/mobile/navigation-ru.jsx 3.41 KiB [built]
     | ./src/pages/__100_days — копия/mobile/steps-ru.jsx 3.55 KiB [built]
     | ./src/pages/__100_days — копия/mobile/advantages-ru.jsx 8.28 KiB [built]
     | ./src/pages/__100_days — копия/mobile/grace-period-ru.jsx 9.84 KiB [built]
     | ./src/pages/__100_days — копия/mobile/refinance-ru.jsx 4.89 KiB [built]
     | ./src/pages/__100_days — копия/mobile/required-documents-ru.jsx 1.26 KiB [built]
     | ./src/pages/__100_days — копия/mobile/feedbacks-ru.jsx 2.68 KiB [built]
     | ./src/pages/__100_days — копия/mobile/good-to-know-ru.jsx 147 KiB [built]
     | ./src/pages/__100_days — копия/mobile/anketa-ru.jsx 11.9 KiB [built]
     | ./src/pages/__100_days — копия/mobile/footer-mobile-ru.jsx 5.53 KiB [built]
     | ./src/pages/__100_days — копия/mobile/seo-cities-ru.jsx 1.15 KiB [built]
 [8] ./src/pages/__aeroflot/mobile/index.jsx + 13 modules 198 KiB {0} [optional] [built]
     | ./src/pages/__aeroflot/mobile/index.jsx 15.3 KiB [optional] [built]
     | ./src/pages/__aeroflot/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__aeroflot/mobile/header-mobile-ru.jsx 3.84 KiB [built]
     | ./src/pages/__aeroflot/mobile/meta-ru.jsx 2.01 KiB [built]
     | ./src/pages/__aeroflot/mobile/breadcrumbs-ru.jsx 610 bytes [built]
     | ./src/pages/__aeroflot/mobile/navigation-ru.jsx 1.88 KiB [built]
     | ./src/pages/__aeroflot/mobile/get-card-ru.jsx 3.81 KiB [built]
     | ./src/pages/__aeroflot/mobile/conditions-ru.jsx 43.4 KiB [built]
     | ./src/pages/__aeroflot/mobile/debit-card-plus-ru.jsx 7.01 KiB [built]
     | ./src/pages/__aeroflot/mobile/gain-more-ru.jsx 4.87 KiB [built]
     | ./src/pages/__aeroflot/mobile/apply-card-form-ru.jsx 45.2 KiB [built]
     | ./src/pages/__aeroflot/mobile/good-to-know-ru.jsx 61.6 KiB [built]
     | ./src/pages/__aeroflot/mobile/footer-mobile-ru.jsx 6.09 KiB [built]
     | ./src/pages/__aeroflot/mobile/seo-cities-ru.jsx 1.15 KiB [built]
 [9] ./src/pages/__100_days_ab/mobile/index.jsx + 13 modules 224 KiB {0} [optional] [built]
     | ./src/pages/__100_days_ab/mobile/index.jsx 24 KiB [optional] [built]
     | ./src/pages/__100_days_ab/mobile/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days_ab/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__100_days_ab/mobile/header-mobile-ru.jsx 3.78 KiB [built]
     | ./src/pages/__100_days_ab/mobile/navigation-ru.jsx 2.21 KiB [built]
     | ./src/pages/__100_days_ab/mobile/advantages-ru.jsx 8.12 KiB [built]
     | ./src/pages/__100_days_ab/mobile/grace-period-ru.jsx 9.84 KiB [built]
     | ./src/pages/__100_days_ab/mobile/refinance-ru.jsx 4.92 KiB [built]
     | ./src/pages/__100_days_ab/mobile/required-documents-ru.jsx 1.22 KiB [built]
     | ./src/pages/__100_days_ab/mobile/get-card-ru.jsx 3.55 KiB [built]
     | ./src/pages/__100_days_ab/mobile/good-to-know-ru.jsx 146 KiB [built]
     | ./src/pages/__100_days_ab/mobile/anketa-ru.jsx 11.1 KiB [built]
     | ./src/pages/__100_days_ab/mobile/footer-mobile-ru.jsx 5.53 KiB [built]
     | ./src/pages/__100_days_ab/mobile/seo-cities-ru.jsx 1.15 KiB [built]
[10] ./src/pages/__business_card/desktop/index.jsx + 13 modules 221 KiB {0} [optional] [built]
     | ./src/pages/__business_card/desktop/index.jsx 7.03 KiB [optional] [built]
     | ./src/pages/__business_card/desktop/meta-ru.jsx 1.6 KiB [built]
     | ./src/pages/__business_card/desktop/header-desktop-ru.jsx 20.5 KiB [built]
     | ./src/pages/__business_card/desktop/credit-card-ru.jsx 7.76 KiB [built]
     | ./src/pages/__business_card/desktop/navigation-ru.jsx 2.81 KiB [built]
     | ./src/pages/__business_card/desktop/credit-card-benefits-ru.jsx 9.59 KiB [built]
     | ./src/pages/__business_card/desktop/how-it-works-ru.jsx 6.14 KiB [built]
     | ./src/pages/__business_card/desktop/tariffs-ru.jsx 76.4 KiB [built]
     | ./src/pages/__business_card/desktop/how-open-account-ru.jsx 4.08 KiB [built]
     | ./src/pages/__business_card/desktop/open-account-ru.jsx 12.7 KiB [built]
     | ./src/pages/__business_card/desktop/good-to-know-ru.jsx 64.4 KiB [built]
     | ./src/pages/__business_card/desktop/widget-footer-desktop-v-2-ru.jsx 5.99 KiB [built]
     | ./src/pages/__business_card/desktop/agreement-popup-desktop-ru.jsx 1.14 KiB [built]
     | ./src/pages/__business_card/desktop/seo-cities-ru.jsx 1.15 KiB [built]
[11] ./src/pages/__100_days_ab — копия/mobile/index.jsx + 13 modules 224 KiB {0} [optional] [built]
     | ./src/pages/__100_days_ab — копия/mobile/index.jsx 24 KiB [optional] [built]
     | ./src/pages/__100_days_ab — копия/mobile/meta-ru.jsx 2.28 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/header-mobile-ru.jsx 3.78 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/navigation-ru.jsx 2.21 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/advantages-ru.jsx 8.12 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/grace-period-ru.jsx 9.84 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/refinance-ru.jsx 4.92 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/required-documents-ru.jsx 1.22 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/get-card-ru.jsx 3.55 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/good-to-know-ru.jsx 146 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/anketa-ru.jsx 11.1 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/footer-mobile-ru.jsx 5.53 KiB [built]
     | ./src/pages/__100_days_ab — копия/mobile/seo-cities-ru.jsx 1.15 KiB [built]
[12] ./src/pages/__business_card — копия/desktop/index.jsx + 13 modules 221 KiB {0} [optional] [built]
     | ./src/pages/__business_card — копия/desktop/index.jsx 7.03 KiB [optional] [built]
     | ./src/pages/__business_card — копия/desktop/meta-ru.jsx 1.6 KiB [built]
     | ./src/pages/__business_card — копия/desktop/header-desktop-ru.jsx 20.5 KiB [built]
     | ./src/pages/__business_card — копия/desktop/credit-card-ru.jsx 7.76 KiB [built]
     | ./src/pages/__business_card — копия/desktop/navigation-ru.jsx 2.81 KiB [built]
     | ./src/pages/__business_card — копия/desktop/credit-card-benefits-ru.jsx 9.59 KiB [built]
     | ./src/pages/__business_card — копия/desktop/how-it-works-ru.jsx 6.14 KiB [built]
     | ./src/pages/__business_card — копия/desktop/tariffs-ru.jsx 76.4 KiB [built]
     | ./src/pages/__business_card — копия/desktop/how-open-account-ru.jsx 4.08 KiB [built]
     | ./src/pages/__business_card — копия/desktop/open-account-ru.jsx 12.7 KiB [built]
     | ./src/pages/__business_card — копия/desktop/good-to-know-ru.jsx 64.4 KiB [built]
     | ./src/pages/__business_card — копия/desktop/widget-footer-desktop-v-2-ru.jsx 5.99 KiB [built]
     | ./src/pages/__business_card — копия/desktop/agreement-popup-desktop-ru.jsx 1.14 KiB [built]
     | ./src/pages/__business_card — копия/desktop/seo-cities-ru.jsx 1.15 KiB [built]
[13] ./src/pages/__aeroflot — копия/mobile/index.jsx + 13 modules 198 KiB {0} [optional] [built]
     | ./src/pages/__aeroflot — копия/mobile/index.jsx 15.3 KiB [optional] [built]
     | ./src/pages/__aeroflot — копия/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/header-mobile-ru.jsx 3.84 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/meta-ru.jsx 2.01 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/breadcrumbs-ru.jsx 610 bytes [built]
     | ./src/pages/__aeroflot — копия/mobile/navigation-ru.jsx 1.88 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/get-card-ru.jsx 3.81 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/conditions-ru.jsx 43.4 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/debit-card-plus-ru.jsx 7.01 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/gain-more-ru.jsx 4.87 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/apply-card-form-ru.jsx 45.2 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/good-to-know-ru.jsx 61.6 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/footer-mobile-ru.jsx 6.09 KiB [built]
     | ./src/pages/__aeroflot — копия/mobile/seo-cities-ru.jsx 1.15 KiB [built]
[14] ./src/pages/__business_card — копия/mobile/index.jsx + 12 modules 194 KiB {0} [optional] [built]
     | ./src/pages/__business_card — копия/mobile/index.jsx 4.55 KiB [optional] [built]
     | ./src/pages/__business_card — копия/mobile/meta-ru.jsx 1.6 KiB [built]
     | ./src/pages/__business_card — копия/mobile/agreement-popup-mobile-ru.jsx 1.08 KiB [built]
     | ./src/pages/__business_card — копия/mobile/header-mobile-ru.jsx 4.07 KiB [built]
     | ./src/pages/__business_card — копия/mobile/credit-card-ru.jsx 6.54 KiB [built]
     | ./src/pages/__business_card — копия/mobile/credit-card-benefits-ru.jsx 4.13 KiB [built]
     | ./src/pages/__business_card — копия/mobile/how-it-wokrs-ru.jsx 5.68 KiB [built]
     | ./src/pages/__business_card — копия/mobile/tariffs-ru.jsx 78.1 KiB [built]
     | ./src/pages/__business_card — копия/mobile/get-card-ru.jsx 4.11 KiB [built]
     | ./src/pages/__business_card — копия/mobile/open-account-ru.jsx 12.6 KiB [built]
     | ./src/pages/__business_card — копия/mobile/good-to-know-ru.jsx 64.3 KiB [built]
     | ./src/pages/__business_card — копия/mobile/footer-mobile-ru.jsx 6.03 KiB [built]
     | ./src/pages/__business_card — копия/mobile/seo-cities-ru.jsx 1.15 KiB [built]
    + 143 hidden modules

User@DESKTOP-A7F09KU  /c/work/webpack-sources-leak-repro (master)

@sokra
Copy link
Member

sokra commented Oct 2, 2019

hmm... So to conclude this seem to be a fixed node.js bug/inefficiency that occurs in macOS with node < 12.1.0. I don't think it's worth trying to find and adding a workaround in source, as there are solutions (upgrade node, or increase memory) available. For performance reasons lastest node.js is recommended anyway.

@sokra sokra closed this as completed Oct 2, 2019
@vankop
Copy link
Member

vankop commented Oct 2, 2019

for me still works only with increased memory.
Dockerfile

FROM node:12

COPY package.json .
COPY yarn.lock .

RUN yarn

COPY . .

RUN node -v

CMD ["node", "--max_old_space_size=4112", "index.js"]

index.js

const webpack = require('webpack');
const config = require('./webpack.config');

process.on('SIGTERM', function() {
	console.log('terminating');
	process.exit(1);
});

console.log('node version ' +  process.version);

webpack(config, () => {
	console.log('build finished');
});

run with docker build -t webpack-leak . && docker run -it --memory=5gb webpack-leak

if setup 1500mb as memory limit I get out of memory =(

Anyway looks like Node.js issue (if you don't have this problem) . Sorry for spam

@Diokuz
Copy link

Diokuz commented Nov 13, 2019

Have this problem on node 12.13.0.

@liby
Copy link

liby commented Mar 17, 2021

@alexander-akait
None of the above replies provides a “reproducible test repo”, so how did you finally find the bug and fix it?

@alexander-akait
Copy link
Member

alexander-akait commented Mar 17, 2021

We got report in webpack repo

@daychongyang
Copy link

@alexander-akait
Is this problem fixed in webpack@5.26.3?

When I use the latest version, memory leaks still occur, causing the process to exit abnormally.

Environmental information

$ yarn why webpack
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "webpack"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "webpack@5.26.3"
info Reasons this module exists
   - "@ez#preset-web-react#@ez#plugin-platform-web" depends on it
   - Hoisted from "@ez#preset-web-react#@ez#plugin-platform-web#webpack"
info Disk size without dependencies: "4.86MB"
info Disk size with unique dependencies: "11.07MB"
info Disk size with transitive dependencies: "22.33MB"
info Number of shared dependencies: 43
✨  Done in 0.62s.
  System:
    OS: macOS 11.1
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.5 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.11 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Safari: 14.0.2

Error Info

<--- Last few GCs --->

[46086:0x1046c8000]  1785893 ms: Mark-sweep 2024.5 (2061.4) -> 2016.3 (2057.6) MB, 1567.5 / 0.1 ms  (average mu = 0.090, current mu = 0.009) allocation failure scavenge might not succeed
[46086:0x1046c8000]  1785914 ms: Scavenge 2025.9 (2059.2) -> 2018.1 (2059.2) MB, 1.6 / 0.0 ms  (average mu = 0.090, current mu = 0.009) allocation failure 


<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012e4da5 node::Abort() (.cold.1) [/usr/local/bin/node]
 2: 0x1000a6239 node::Abort() [/usr/local/bin/node]
 3: 0x1000a639f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 4: 0x1001e9057 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0x1001e8ff3 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 6: 0x100397ee5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 7: 0x1003999aa v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
 8: 0x100395079 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
 9: 0x100392911 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
10: 0x1003a11aa v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x1003a1231 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0x10036ebd7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
13: 0x1006ed928 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x100a7a279 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@alexander-akait
Copy link
Member

Leak in custom plugin

@daychongyang
Copy link

Leak in custom plugin

Do you mean the problem with my own code? Can you teach me how to identify it?🙋

@alexander-akait
Copy link
Member

Experience 😄 Anyway if you provide reproducible example, I will look at this

@daychongyang
Copy link

Experience 😄 Anyway if you provide reproducible example, I will look at this

🤤

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait

I also ran into this problem with Webpack@5.26.2. But I'm sorry that I can't provide a "reproducible test repo".

Environmental information
❯ yarn why webpack
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "webpack"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "webpack@5.26.2"
info Has been hoisted to "webpack"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "11.18MB"
info Disk size with unique dependencies: "18.85MB"
info Disk size with transitive dependencies: "33.36MB"
info Number of shared dependencies: 76
=> Found "@storybook/react#webpack@4.44.2"
info This module exists because "@storybook#react" depends on it.
info Disk size without dependencies: "2.41MB"
info Disk size with unique dependencies: "13.17MB"
info Disk size with transitive dependencies: "29.46MB"
info Number of shared dependencies: 114
=> Found "@storybook/core#webpack@4.44.2"
info This module exists because "@storybook#react#@storybook#core" depends on it.
info Disk size without dependencies: "6MB"
info Disk size with unique dependencies: "16.77MB"
info Disk size with transitive dependencies: "33.06MB"
info Number of shared dependencies: 114
✨  Done in 1.46s.
  System:
    OS: Big Sur 11.2.1 (20D75)
    CPU: 3.1 GHz 6-Core Intel Core i5
    Shell: zsh 5.8 (x86_64-apple-darwin20.0) - /bin/zsh
  Binaries:
    Node: 14.15.5 - /Users/user/.nvs/default/bin/node
    Yarn: 1.22.10 - /Users/user/.nvs/default/bin/yarn
    npm: 6.14.11 - /Users/user/.nvs/default/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
Error Info
<--- Last few GCs --->

[14351:0x108008000] 108702018 ms: Scavenge (reduce) 8128.9 (8213.5) -> 8128.4 (8213.5) MB, 11.7 / 0.0 ms  (average mu = 0.157, current mu = 0.010) allocation failure
[14351:0x108008000] 108702062 ms: Scavenge (reduce) 8129.0 (8210.5) -> 8128.5 (8212.0) MB, 6.2 / 0.0 ms  (average mu = 0.157, current mu = 0.010) allocation failure
[14351:0x108008000] 108703458 ms: Scavenge (reduce) 8129.3 (8211.0) -> 8128.6 (8212.0) MB, 5.4 / 0.0 ms  (average mu = 0.157, current mu = 0.010) allocation failure


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1012d96a5 node::Abort() (.cold.1) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 2: 0x1000a6309 node::Abort() [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 3: 0x1000a646f node::OnFatalError(char const*, char const*) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 4: 0x1001e8f57 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 5: 0x1001e8ef3 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 6: 0x100395df5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 7: 0x10039789a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 8: 0x100392fc5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
 9: 0x1003908f0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
10: 0x10039ad50 v8::internal::Heap::FinalizeIncrementalMarkingIfComplete(v8::internal::GarbageCollectionReason) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
11: 0x1003aaf4a v8::internal::IncrementalMarkingJob::Task::RunInternal() [/Users/user/.nvs/node/14.15.5/x64/bin/node]
12: 0x10011243b node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
13: 0x100110ed7 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/Users/user/.nvs/node/14.15.5/x64/bin/node]
14: 0x1009eccdb uv__async_io [/Users/user/.nvs/node/14.15.5/x64/bin/node]
15: 0x100a00aac uv__io_poll [/Users/user/.nvs/node/14.15.5/x64/bin/node]
16: 0x1009ed261 uv_run [/Users/user/.nvs/node/14.15.5/x64/bin/node]
17: 0x1000e6827 node::NodeMainInstance::Run() [/Users/user/.nvs/node/14.15.5/x64/bin/node]
18: 0x100079c56 node::Start(int, char**) [/Users/user/.nvs/node/14.15.5/x64/bin/node]
19: 0x7fff2053c621 start [/usr/lib/system/libdyld.dylib]
20: 0x7
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@alexander-akait
Copy link
Member

You still on @storybook/core#webpack@4.44.2, there are a lot of bugs/memory problems, you need consider migration to v5...

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait
I did not start the storybook service, I'm pretty sure it has nothing to do with the storybook. It was our own project that started the service and crashed due to a memory leak.

@alexander-akait
Copy link
Member

@liby Can you run npm ls webpack?

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait

❯ npm ls webpack
project@1.0.0 /Users/user/Code/project
├─┬ @storybook/react@6.1.21
│ ├─┬ @storybook/core@6.1.21
│ │ └── webpack@4.44.2
│ └── webpack@4.44.2
└─┬ react-docgen-typescript-loader@3.7.2
  └─┬ @webpack-contrib/schema-utils@1.0.0-beta.0
    └── webpack@4.44.2  extraneous

npm ERR! extraneous: webpack@4.44.2 /Users/user/Projects/project/node_modules/@webpack-contrib/schema-utils/node_modules/webpack

@alexander-akait
Copy link
Member

Yep, you still on webpack v4, but we have v5 with a lot of fixes, also storybook supports webpack v5 https://storybook.js.org/blog/storybook-for-webpack-5/

@liby
Copy link

liby commented Mar 19, 2021

There are several issues:

  1. We did not encounter this error in our project with webpack@4
  2. the results of npm ls are inaccurate, as follows:
     ❯ yarn why react
    yarn why v1.22.10
    [1/4] 🤔  Why do we have the module "react"...?
    [2/4] 🚚  Initialising dependency graph...
    [3/4] 🔍  Finding dependency...
    [4/4] 🚡  Calculating file sizes...
    => Found "react@17.0.1"
    info Has been hoisted to "react"
    info This module exists because it's specified in "dependencies".
    info Disk size without dependencies: "364KB"
    info Disk size with unique dependencies: "412KB"
    info Disk size with transitive dependencies: "440KB"
    info Number of shared dependencies: 3
    ✨  Done in 0.89s.
    ❯ npm ls react
    project@1.0.0 /Users/user/Projects/project
    └── (empty)
    
  3. The project we started must have been build with webpack@5, if it was build with storybook's webpack@4, then it's not compatible in terms of configuration.

@alexander-akait
Copy link
Member

I don't understand you

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait
Not related to storybook. The npm ls command has a problem with the output, we clearly have React installed, but it outputs empty.
Our crashed project was build with webpack@5, there is no doubt about it. Our configuration is based on webpack@5, which is completely incompatible with webpack@4.

@alexander-akait
Copy link
Member

Okay, run yarn why webpack

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait
It's exactly the same as the one offered for the first time.

❯ yarn why webpack
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "webpack"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "webpack@5.26.3"
info Has been hoisted to "webpack"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "11.18MB"
info Disk size with unique dependencies: "18.85MB"
info Disk size with transitive dependencies: "33.36MB"
info Number of shared dependencies: 76
=> Found "@storybook/react#webpack@4.44.2"
info This module exists because "@storybook#react" depends on it.
info Disk size without dependencies: "2.41MB"
info Disk size with unique dependencies: "13.17MB"
info Disk size with transitive dependencies: "29.46MB"
info Number of shared dependencies: 114
=> Found "@storybook/core#webpack@4.44.2"
info This module exists because "@storybook#react#@storybook#core" depends on it.
info Disk size without dependencies: "6MB"
info Disk size with unique dependencies: "16.77MB"
info Disk size with transitive dependencies: "33.06MB"
info Number of shared dependencies: 114
✨  Done in 1.65s.

@alexander-akait
Copy link
Member

As you can see you still on webpack v4, the error happens on v5? Please provide some more information

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait
As you can see, webpack@4 is what Storybook does when using. And your claim that the project will rely on webpack in Storybook when developed locally is not supported by any evidence at all

More information:

=> Found "webpack@5.26.3"
info Has been hoisted to "webpack"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "11.18MB"
info Disk size with unique dependencies: "18.85MB"
info Disk size with transitive dependencies: "33.36MB"
info Number of shared dependencies: 76

Should we follow the version installed in the node_ modules folder?

/Users/user/Projects/project
❯ ./node_modules/.bin/webpack -v
webpack 5.26.3
webpack-cli 4.5.0
webpack-dev-server 3.11.2

@alexander-akait
Copy link
Member

alexander-akait commented Mar 19, 2021

Should we follow the version installed in the node_ modules folder?

Good question, we need to look at logic in storybook here, hard to say

@liby
Copy link

liby commented Mar 19, 2021

@alexander-akait
There's no point in speculating, so I'll remove Storybook from the project and keep an eye on it to see if the issue comes up again. This is the best solution I can think of.
Thank you for discussing this with me for so long, have a great day!

@alexander-akait
Copy link
Member

Feel free to feedback

@Tosinkoa
Copy link

Is there any solution? I'm facing this problem right now

@alexander-akait
Copy link
Member

Please run npx webpack-cli info

@Tosinkoa
Copy link

Here is the result @alexander-akait

PS C:\Users\user\practice-project> npx webpack-cli info
Need to install the following packages:
webpack-cli
Ok to proceed? (y) y
[webpack-cli] Error: Command failed: wmic os get Caption
'wmic' is not recognized as an internal or external command,
operable program or batch file.

at b (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\envinfo\dist\envinfo.js:1:95303)
at Function.e.exports.sync (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\envinfo\dist\envinfo.js:1:97166)
at e.exports (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\envinfo\dist\envinfo.js:1:93520)
at e.exports (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\envinfo\dist\envinfo.js:1:92667)
at C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\envinfo\dist\envinfo.js:1:91417
at async Promise.all (index 15)
at async Command.<anonymous> (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\@webpack-cli\info\lib\index.js:78:24)
at async Promise.all (index 1)
at async Command.<anonymous> (C:\Users\user\AppData\Local\npm-cache\_npx\73f0de3f6fbaf968\node_modules\webpack-cli\lib\webpack-cli.js:1672:7) {

stdout: '',
stderr: "'wmic' is not recognized as an internal or external command,\r\n" +
'operable program or batch file.\r\n',
failed: true,
signal: null,
cmd: 'wmic os get Caption',
timedOut: false

@alexander-akait
Copy link
Member

oh, that is weird, looks bug in envinfo...

@Tosinkoa
Copy link

Can you please break it down?

@ichiriac
Copy link

Hi, I've got the same problem with node v14.18.3

In my cse I was on a debian 11 server with 1 go of ram (and 2 Go of swap) and got the same problem.

I've ran export NODE_OPTIONS="--max-old-space-size=1024" and then relaunched the build, used some swap but it passed.

Hope can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests