I’m submitting a bug report
See this plugin
Webpack version:
1.10.x
Please tell us about your environment:
OSX 10.11.6
Current behavior:
Recurrent builds (webpack-dev-server) with this plugin causes a memory leak which eventually crashes Node.js
Expected/desired behavior:
I would not expect this plugin to introduce a memory leak as I am not retaining any references. Does creating a child compiler cause a leak somehow?
Using the following plugin: https://gist.github.com/iammerrick/945dac5d5049b309ee878c0fcb6a43f0 Which uses the assets output by the webpack build to create a service worker in a template like fashion.
new ServiceWorkerPlugin({
entry: './src/sw',
output: 'sw.js'
}),
This plugin works as expected, however when used with webpack-dev-server every build grows memory until node eventually kills the process.
- What is the expected behavior?
Memory to state stable as it does without this plugin.
- What is the motivation / use case for changing the behavior?
Maybe behavior doesn’t need to change? Maybe I just need better understanding of the child compiler API or a different way to solve this problem?
- Language: [all]
@TheLarkInn dude! Don’t apologize, I am just so grateful for your help and enthusiasm. Fixing this is my full time job starting tomorrow (finally got my other tasks done for this sprint), I just know very little about webpack internals and why creating a child compiler would create a webpack leak so wanted to share it with people with more insight than me 😀
Do you use
[hash]
or[chunkhah]
in your filenames? This will cause a leak.