image-webpack-loader icon indicating copy to clipboard operation
image-webpack-loader copied to clipboard

EventEmitter memory leak

Open Lammmas opened this issue 8 years ago • 7 comments

Upon using even the most basic 'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false' I get the following errors:

(node) warning: possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:239:17)
    at module.exports (H:\Dev\node_modules\signal-exit\index.js:41:11)
    at module.exports.promise (H:\Dev\node_modules\execa\index.js:146:23)
    at H:\Dev\node_modules\exec-buffer\index.js:35:15

As soon as I remove the loader, everything is fine.

My webpack:

var webpack = require('webpack'),
    HtmlWebpackPlugin = require('html-webpack-plugin'),
    ExtractTextPlugin = require('extract-text-webpack-plugin'),
    helpers = require('./helpers');

module.exports = {
    entry: {
        'polyfills': './src/polyfills.ts',
        'vendor': './src/vendor.ts',
        'app': './src/main.ts'
    },

    resolve: {
        extensions: ['', '.js', '.ts']
    },

    module: {
        loaders: [
            {
                test: /\.ts$/,
                loaders: [
                    'awesome-typescript-loader',
                    'angular2-template-loader'
                ]
            },
            {
                test: /\.html$/,
                loader: 'html'
            },
            {
                test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
                loaders: [
                    'file?name=assets/[name].[hash].[ext]',
                    'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
                ]
            },
            {
                test: /\.css$/,
                exclude: helpers.root('src', 'app'),
                loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
            },
            {
                test: /\.css$/,
                include: helpers.root('src', 'app'),
                loader: 'raw'
            }
        ]
    },

    plugins: [
        new webpack.optimize.CommonsChunkPlugin({
            name: ['app', 'vendor', 'polyfills']
        }),

        new HtmlWebpackPlugin({
            template: 'src/index.html'
        }),

        new webpack.ProvidePlugin({
            jQuery: 'jquery',
            $: 'jquery',
            jquery: 'jquery'
        })
    ],
};

Lammmas avatar Oct 25 '16 12:10 Lammmas

I have a same problem.@Lammmas Here 's My webpack:

config.loader('images', {
        test: /\.(jpe?g|png|gif|svg)(\?.*)?$/i,
        loaders: [
            'url-loader?limit=10000&&name=images/[name]-[hash].[ext]',
            'image-webpack-loader?{progressive:true, optimizationLevel: 7, interlaced: false, mozjpeg:{quality:85}, pngquant:{quality: "65-90", speed: 4}}', // eslint-disable-line
        ],
    })

Wangshino avatar Nov 08 '16 11:11 Wangshino

I have a same problem. when many background-image: url('./*.png') in *.less or *.css

xwxtwd avatar Nov 09 '16 03:11 xwxtwd

How to solve this?

alex-shamshurin avatar Nov 11 '16 21:11 alex-shamshurin

For me the problem is in exec-buffer and yarn why says that

This module exists because "image-webpack-loader#imagemin-gifsicle" depends on it

havenchyk avatar Nov 17 '16 10:11 havenchyk

okay, here is a root cause https://github.com/sindresorhus/execa/issues/61

havenchyk avatar Nov 17 '16 10:11 havenchyk

I have the same issue. Is there any workaround?

granmoe avatar Nov 17 '16 19:11 granmoe

+1

alex-shamshurin avatar Nov 17 '16 20:11 alex-shamshurin