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

Unable to load image files #51

Closed
EvHaus opened this issue Oct 26, 2016 · 36 comments
Closed

Unable to load image files #51

EvHaus opened this issue Oct 26, 2016 · 36 comments

Comments

@EvHaus
Copy link

EvHaus commented Oct 26, 2016

After upgrading to 3.0.0, I'm getting this error:

 ERROR in ./static/dist/images/products/Product_Landing_Quote.jpg
[2]     Module build failed: Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
[2]       Referenced from: /Users/ev/Git/cumul8.com/node_modules/mozjpeg/vendor/cjpeg
[2]       Reason: image not found
[2]     
[2]         at Promise.all.then.arr (/Users/ev/Git
[2] /cumul8.com/node_modules/execa/index.js:170:11)
[2]         at process._tickCallback (internal/process/next_tick.js:103:7)
[2]      @ ./~/css-loader?module&localIdentName=[name]__[local]___[hash:base64:5]!./~/postcss-loader!./~/stylus-loader!./src/styles/pages/Products.styl 6:2152-2225

This error doesn't happen on the 2.x.x version.

@shelldandy
Copy link

I'm having that same issue ☹️ no idea what's going on

@shelldandy
Copy link

Found the solution as random as it seems its all fixed by running brew install libpng wtf is going on haha

@codylindley
Copy link

Same issue, @Mike3run fix, resolved it. Stinks this has to be done.

@IgorGee
Copy link

IgorGee commented Nov 24, 2016

I had the same issue on Ubuntu 16.10.

Apparently, they removed libpng12 in favor of libpng16?
In any case, here's the link for downloading the library.

@tcoopman
Copy link
Owner

This looks similar to imagemin/imagemin-mozjpeg#23
Could you report this bug at https://github.com/imagemin/imagemin-mozjpeg?

@tcoopman
Copy link
Owner

The true reason is found here: imagemin/mozjpeg-bin#18

@davidnguyen11
Copy link

Found the solution as random as it seems its all fixed by running brew install libpng wtf is going on haha

this solution worked for me. Thank @Mike3run

@modernserf
Copy link
Contributor

Is this "the new normal"? Will this be documented in the readme?

@tcoopman
Copy link
Owner

It would be nice if someone could document this issue in the readme and submit a PR.

@tcoopman
Copy link
Owner

I'll close this for the moment. It's not fixed but it's documented in the README (see #66). Thanks @modernserf

@Shwrndasink
Copy link

@Mike3run thanks. I dunno how that brew install libpng fixed it but it did

@DavidDionise
Copy link

seriously... that's crazy. random af but THANK YOU

@jamesont
Copy link

jamesont commented Mar 8, 2017

brew install libpng did not work for me. are there other suggestions?

@shelldandy
Copy link

@jamesont why don't you paste whatever the console spitted out so we can take a look.

At least the libpng thing was like that for me and several other people here, its usually right there but we don't read it the first time 😝

We can figure this out together

@jamesont
Copy link

jamesont commented Mar 9, 2017

Thanks @Mike3run ! Just a sec while I run build. Ok here ya go:
screen shot 2017-03-09 at 2 28 10 pm

@shelldandy
Copy link

I think that error has nothing to do with this plugin it says can't resolve ../assets/big and ../assets/small

So maybe you did a require or import to the wrong place...

Protip its the 2 chunks of red text, you'll see more info there 😄

@jamesont
Copy link

jamesont commented Mar 9, 2017

@Mike3run Thanks mike. I've tried a million things, I'm not sure where to go. This is actually from a Udemy course I've been taking online, and I've checked and re-checked the code. Can't figure out what the problem might be. I've tried messing with those file paths; nothing seems to help.

@kenguie
Copy link

kenguie commented Mar 11, 2017

@jamesont, I'm doing the same course on Webpack 2.0 ... something in homebrew is broken.
run- brew install libpng
and it should all work after that.

@shelldandy
Copy link

@kenguie just to clarify webpack has nothing to do with libpng aka this doesn't mean webpack is broken not even an issue of this loader even since this is only a thin wrapper on imagemin so your concerns should be directed there.

@kenguie
Copy link

kenguie commented Mar 11, 2017

Sorry, mistyped @Mike3run - meant to say homebrew ... I was trying to give @jamesont a note and move to the next lesson :) - fixed it

@jamesont
Copy link

jamesont commented Mar 14, 2017 via email

@jamesont
Copy link

jamesont commented Mar 14, 2017 via email

@jamesont
Copy link

jamesont commented Mar 14, 2017 via email

@shelldandy
Copy link

imagemin/imagemin#234

@jamesont
Copy link

jamesont commented Mar 14, 2017 via email

@kenguie
Copy link

kenguie commented Mar 14, 2017

I actually just typed 'brew install libpng' and after that according to my history I ran 'npm run build' and it all worked out. I had the same errors though before that.

@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.

@shelldandy
Copy link

@forgo not use this package? just go with normal file loader, this also adds an extra cpu bourden, you could process the images on your computer first and be done with it

@DWboutin
Copy link

DWboutin commented May 5, 2017

Will it be resolved or the only way to get it to work is brew install libpng ?

@lensisle
Copy link

I solved this same issue installing 'libpng' as @kenguie said, and then installing the file-loader module:
'npm install file-loader --save-dev'.

After that I ran 'npm run build' and everything worked ok!

@jamesont
Copy link

jamesont commented May 14, 2017 via email

@sami718
Copy link

sami718 commented Jul 14, 2017

Resolved my issue with .....brew install libpng ..thanks @Mike3run

@chenyiqi
Copy link

chenyiqidembp# brew install libpng
==> Downloading https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "libpng"
Download failed: https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz
chenyiqidembp#

I don`t know how to init libpng

@JoachimHarris
Copy link

Still fixing the problem one year later 👯‍♂️

@bamacaerick
Copy link

bamacaerick commented Nov 20, 2017

I did this two things (based on previous comments):
brew install libpng and then npm install file-loader --save-dev and everything is running fine now.

@joshhead
Copy link

joshhead commented Dec 7, 2017

In addition to brew install libpng I also ran brew install automake and brew install nasm. Without those, the postinstall command for the mozjpeg npm package has errors building the native mozjpeg executables on my machine.

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