Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Error trying to load JPG images. #92

Closed
michaelpumo opened this issue Apr 14, 2017 · 3 comments
Closed

Error trying to load JPG images. #92

michaelpumo opened this issue Apr 14, 2017 · 3 comments

Comments

@michaelpumo
Copy link

Hi,

I have been loading PNG files just fine, but today I wanted to use JPG images too.

I get the following error:

ERROR in ./src/images/dimt.jpg
Module build failed: Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Applications/MAMP/htdocs/portfolio/node_modules/mozjpeg/vendor/cjpeg
  Reason: Incompatible library version: cjpeg requires version 36.0.0 or later, but libpng16.16.dylib provides version 27.0.0

    at Promise.all.then.arr (/Applications/MAMP/htdocs/portfolio/node_modules/execa/index.js:201:11)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/pug/app.pug 1:5016-5045
 @ multi ./src/pug/app.pug ./src/js/app.js ./src/scss/app.scss

Any idea what's going on here?

Here's my webpack config for the loader section:

{
        test: /\.(jpe?g|png|gif)$/i,
        use: [
          {
            loader: 'file-loader',
            options: {
              name: '/images/[name].[ext]'
            }
          },
          {
            loader: 'image-webpack-loader',
            options: {
              progressive: false,
              optipng: {
                optimizationLevel: 7,
                quality: '65-70',
                speed: 4
              },
              mozjpeg: {
                quality: 90
              },
              gifsicle: {
                interlaced: false
              }
            }
          }
        ]
      }

Thanks

@michaelpumo
Copy link
Author

UPDATE:

Referring to this issue:
#51

Install brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then install:
brew install libpng

Now it seems to work. Weird!

@forgo
Copy link

forgo commented Apr 18, 2017

I don't have administrative privileges on the remote Red Hat build machine I am using in our environment. Why do I need to install a system-level binary to make image-webpack-loader play nicely with Node/NPM/Webpack? This should not be the case.

Has anybody looked into the long-term solution for those of us who cannot simply install libpng? Any help would be appreciated.

@tcoopman
Copy link
Owner

A long term solution is that this error is reported at the correct dependency and that they fix it.

See #51 and #93

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants