question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v2.4.1 crashes due to a memory leak/exclude is broken

See original GitHub issue

Bug report

My existing projet works fine with mini-css-extract-plugin@2.3.0. After upgrading to the latest v2.4.1 my project builds fail, seemingly due to some memory leak:

<--- Last few GCs --->

[146088:0x4e466f0]    18721 ms: Mark-sweep (reduce) 2045.8 (2051.7) -> 2045.5 (2054.7) MB, 652.9 / 0.0 ms  (average mu = 0.264, current mu = 0.019) allocation failure scavenge might not succeed
[146088:0x4e466f0]    19389 ms: Mark-sweep (reduce) 2046.5 (2055.2) -> 2046.3 (2055.7) MB, 665.6 / 0.0 ms  (average mu = 0.147, current mu = 0.004) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [node]
 2: 0x96e0af node::FatalError(char const*, char const*) [node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd73fd5  [node]
 6: 0xda496e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [node]
 7: 0xdb09a6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [node]
 8: 0xd9cb3f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [node]
 9: 0xd9cdb8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [node]
10: 0xd8f699 v8::internal::ItemParallelJob::Run() [node]
...

Taking into account v2.4.1 release comments saying bug fix: crash with multiple webpack versions, my first guess, there are still some problems left. I am on the latest webpack@5.57.1, by the way.

Actual Behavior

Presumably v2.4.0 introduces some memory leak, causing crashes at least in some edge-cases.

Expected Behavior

Upgrade from v2.3.0 to v.2.4.1 should not lead to crashes in the projects where build worked with the previous versions.

How Do We Reproduce?

I had no chance to dig into it. I’ll provide a way to reproduce later, if you don’t have an idea already what might be wrong with it.

Please paste the results of npx webpack-cli info here, and mention other relevant information

npx: installed 50 in 7.909s

  System:
    OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 2.16 GB / 11.60 GB
  Binaries:
    Node: 14.18.0 - ~/.nvm/versions/node/v14.18.0/bin/node
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.0/bin/npm
  Browsers:
    Chrome: 94.0.4606.71
    Firefox: 92.0
  Packages:
    babel-loader: ^8.2.2 => 8.2.2 
    css-loader: ^6.3.0 => 6.3.0 
    css-minimizer-webpack-plugin: ^3.1.1 => 3.1.1 
    postcss-loader: ^6.1.1 => 6.1.1 
    resolve-url-loader: ^4.0.0 => 4.0.0 
    sass-loader: ^12.1.0 => 12.1.0 
    webpack: ^5.57.1 => 5.57.1 
    webpack-dev-middleware: ^5.2.1 => 5.2.1 
    webpack-hot-middleware: ^2.25.1 => 2.25.1 
    webpack-merge: ^5.8.0 => 5.8.0 
    workbox-webpack-plugin: ^6.3.0 => 6.3.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
alexander-akaitcommented, Oct 7, 2021

Found a problem, new API used .webpack special extensions to use importModule (new fast and low memory API), but you use exclude: [/styles\.css/, /editor\.css/], so you apply loader infinity time, workaround exclude: [/styles\.css/, /editor\.css/, /\.webpack/],, I think other developers has the same problem, but yes we should fix it, bug

0reactions
alexander-akaitcommented, Oct 9, 2021

Fixed, if somebody faced with the same issue, please update mini-css-extract-plugin to v2.4.2 and webpack to v5.58.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Investigating memory access crashes - Apple Developer
A crash due to a memory access issue occurs when an app uses memory in an unexpected way. Memory access problems have numerous...
Read more >
Game crashes due to out of memory when trying to create ...
It is weird since the PC is having 16 gb of ram and the game not even using 2gb of ram. I've change...
Read more >
Solved: After upgrade Sourcetree 4.1.3 Mac crashes when yo...
When I try to open a repository, or select a file to do a commit on an already open repo, it crashes: Screenshot...
Read more >
Fix memory related crash issues with Illustrator - Adobe Support
If Adobe Illustrator displays the "Not enough memory" error message and crashes, use these solutions to fix the issue.
Read more >
Updates won't work and crash the site - WordPress.org
When I clicked to try and update the two plugins again, it crashed again. ... Auto-updates disabled Yoast Duplicate Post: version: 4.1.2, author:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found