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

Webpack build fails when using imagemin-gifsicle 4.0.1 in production #36

Open
Limoncelo opened this issue Sep 10, 2019 · 0 comments
Open

Comments

@Limoncelo
Copy link

I use imagemin-gifsicle 4.0.1 as a plugin for img-loader in my Webpack 4.39.3 configuration file and I get this error when I run my build in production mode :

 ERROR in ./node_modules/slick-carousel/slick/ajax-loader.gif
    Module build failed (from ./node_modules/img-loader/index.js):
    Error: /projects/node_modules/gifsicle/vendor/gifsicle: /projects/node_modules/gifsicle/vendor/gifsicle: cannot execute binary file
    
        at Promise.all.then.arr (/projects/node_modules/exec-buffer/node_modules/execa/index.js:231:11)
        at process._tickCallback (internal/process/next_tick.js:68:7)
     @ ./node_modules/slick-carousel/slick/slick-theme.css (./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/slick-carousel/slick/slick-theme.css) 4:38-66
     @ ./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/sass-loader/lib/loader.js!./src/css/assets.scss

Here is the part of my configuration file that makes the build fail :

{
    test: /\.(png|jpg|gif|svg)$/i,
    use: [
        {
            loader: 'url-loader',
            options: {
                limit: 8192,
                name: '[name].[hash:7].[ext]'
            },
        },
        {
            loader: 'img-loader',
            options: {
                plugins: !dev && [
                    require('imagemin-gifsicle')({}),
                    require('imagemin-mozjpeg')({}),
                    require('imagemin-optipng')({}),
                    require('imagemin-svgo')({})
                ]
            }
        }
    ],
}

When I comment out the require('imagemin-gifsicle')({}) line, the build works, but I'd like to use the library to handle some gifs in my project... Thank you for your 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

1 participant