tcoopman / image-webpack-loader

Image loader module for webpack
MIT License
2.03k stars 132 forks source link

Error: write EOF when bundling #240

Open mperu92 opened 4 years ago

mperu92 commented 4 years ago

I'm having this error when bundling jpg images using image-webpack-plugin

ERROR in ./wwwroot/images/gallery/15.JPG
Module build failed (from ./node_modules/image-webpack-loader/index.js):
Error: write EOF

I am using webpack v^4.43.0 and image-webpack-plugin v^6.0.0 and node v12.18.0;

This is my webpack.config.js config:

{
    test: /\.(gif|png|jpe?g|svg)$/i,
    loaders: [
        {
            loader: 'file-loader',
            options: {
                name: 'images/[name].[ext]'
            }
        },
        {
            loader: 'image-webpack-loader',
            options: {
                mozjpeg: {
                    progressive: true,
                    quality: 65
                },
                // optipng.enabled: false will disable optipng
                optipng: {
                    enabled: false,
                },
                pngquant: {
                    quality: [0.65, 0.90],
                    speed: 4
                },
                gifsicle: {
                    interlaced: false,
                },
                // the webp option will enable WEBP
                webp: {
                    quality: 75
                }
            }
        },
    ]
}
Liqiuping commented 2 years ago

Hi. if you were working in the mainland of PRC. you'd better uninstall image-webpack-loader and try to cnpm install image-webpack-loader. i came across the same trouble recently.