dist images .png corrupt?
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 https://github.com/gruntjs/grunt-contrib-imagemin/issues/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?
Hi James,
Did you get any errors while the npm install was running, or when running grunt serve:dist? The grunt-contrib-imagemin package can often have issues with installing. This might explain why updating imagemin fixed the serve:dist task for you.
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:
Warning: Assertion failed: (!uv__io_active(&stream->io_watcher, UV__POLLOUT) || !ngx_queue_empty(&stream->write_completed_queue) || !ngx_queue_empty(&stream->write_queue) || stream->shutdown_req != NULL || stream->connect_req != NULL), function uv_read_stop, file ../deps/uv/src/unix/stream.c, line 1329. Use --force to continue.
That 2nd image thing appears not to be consistent (or was I imagining it...). Back to image not rendering from dist build. If it's at all useful I got as far as putting the demo app on Heroku - with non-rendering image: http://jmbrnrd-0000.herokuapp.com/
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. Thanks.
Hmmm. That puts me back to where I started, with the grunt serve:dist error aborting the process just after svgmin
Running "svgmin:dist" (svgmin) task
Done, without errors.
Execution Time (2014-02-23 22:29:56 UTC)
loading tasks 5ms ▇ 1%
svgmin 24ms ▇▇▇ 5%
svgmin:dist 433ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 90%
Total 480ms
Warning: Assertion failed: (!uv__io_active(&stream->io_watcher, UV__POLLOUT) || !ngx_queue_empty(&stream->write_completed_queue) || !ngx_queue_empty(&stream->write_queue) || stream->shutdown_req != NULL || stream->connect_req != NULL), function uv_read_stop, file ../deps/uv/src/unix/stream.c, line 1329. Use --force to continue.
Aborted due to warnings.
Maybe your node version is outdated? What version are you using? Found this from googling that error https://github.com/joyent/node/issues/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 https://github.com/gruntjs/grunt-contrib-imagemin/issues/140 grunt serve:dist was generating an empty {{number}}.yeoman.png file. Adding {cache : false} to imagemin options did the trick.
Thanks for such an awesome generator.
Tive o mesmo problema, apenas apaguei a pasta DISTe gerei novamente e resolveu