-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
dist images .png corrupt? #96
Comments
Hi James, Did you get any errors while the npm install was running, or when running |
Thanks for the speedy response! Very strangely, I just tried adding 2nd .png file and running grunt serve:dist which rendered both the default and additional image correctly - weird. Removing the 2nd image and running again causes the default image not to render ??? No error on install (that I noticed) but this was the original 'serve:dist' error, before I updated the imagemin:
|
That 2nd image thing appears not to be consistent (or was I imagining it...). Back to image not rendering from dist build. |
Hmm, this might be related to the grunt-rev task, which is used to rewrite asset names for the usemin task, specifically for caching purposes. Do you see a difference in the image names referenced in the html, compared to the image names in your dist/public/images folder? |
OK. Checking image names revealed that both images had identical version prefixes. I tried adding a 3rd image and sure enough, all images rendered perfectly again (I wasn't going mad) and had unique version prefixes. Stopping the server and repeating reproduced the issue, with non-rendered images and all images being given identical (in fact the very same as before) version prefixes. Some kind of cache issue? |
Well I checked the heroku version you put up and I can see that the image is actually returning a 200, despite the fact that response appears empty. I'm not exactly sure how rev works, but I think it creates the hash prefix based on the file contents. So if they both have the same prefix it could be because they both had 0 contents to begin with, which fits with what I'm seeing on the heroku instance. In that case, there has to be something going on with imagemin where its just creating empty images in the dist folder rather than compressing them. |
Maybe you could try deleting your node_modules folder and running npm install again. I haven't experienced this issue with my images, so I'm thinking this is likely a system issue, or a problem with the installation. |
...and the duplicated version prefix is the very same one, everytime 'd41d8cd9'. I'll give the npm install a try. |
Hmmm. That puts me back to where I started, with the grunt serve:dist error aborting the process just after svgmin
|
Maybe your node version is outdated? What version are you using? Found this from googling that error nodejs/node-v0.x-archive#5622 |
I'm on v0.10.10. What's the best way of updating? |
If you're using windows, chocolatey is the easiest. http://chocolatey.org/packages/nodejs |
Node update did the trick, many thanks for taking time out to help and keep up the great work. |
Same problem, different solution gruntjs/grunt-contrib-imagemin#140 Thanks for such an awesome generator. |
Tive o mesmo problema, apenas apaguei a pasta |
I'm very much a newbie as far as a full stack approach so please bear with me. I have installed angular-fullstack for the first time, and answered 'y' to all options. Running grunt serve generates a local version perfectly. Great.
However, running 'serve:dist' or 'dist' failed and some searching appeared to point to the imagemin process as a culprit. On this thread gruntjs/grunt-contrib-imagemin#16 Sindre Sorhus suggested updating grunt-contrib-imagemin to fix a similar issue. This update appeared to fix the issue and both 'serve:dist' and 'dist' built successfully.
Unfortunately the 1 .png image used in the demo seems to get corrupted and will not render. Any help would be appreciated?
The text was updated successfully, but these errors were encountered: