grunt-tinypng icon indicating copy to clipboard operation
grunt-tinypng copied to clipboard

Cannot read property 'setRawMode'

Open numanWD opened this issue 9 years ago • 16 comments

Hi I am getting an error only with the pngs.

The message error is:

Running "tinypng:compress_png" (tinypng) task Warning: Cannot read property 'setRawMode' of null Use --force to continue.

Thanks

numanWD avatar Apr 22 '15 16:04 numanWD

I've not ran into this issue before. Can you supply one of the images you this error occurs with?

marrone avatar Aug 19 '15 23:08 marrone

I can confirm this, it happens with all my images. The problem seems to be Node.js 4, when I reverted to 0.10 (using nvm) everything works fine again.

I'll leave one image which causes the error here, but I think it's related to Node.js.

Thanks!

example

gabrielmaldi avatar Oct 06 '15 06:10 gabrielmaldi

Happening to me as well. Although it doesn't appear to be a problem with an image or images. I have two tasks, the first one runs fine, then when the second runs I get the 'setRawMode' warning/error. If I comment the first task in my Gruntfile the second runs fine. The order of the tasks doesn't appear to matter, always chokes on the second one.

danparm avatar Nov 13 '15 15:11 danparm

I have this issue too. :'(

HugoHeneault avatar Nov 25 '15 17:11 HugoHeneault

Just ran in to this same problem today. :-(

txcbenji avatar Dec 01 '15 23:12 txcbenji

Hi, I also have this issue and also on the 2nd task, has anyone managed to get around it without reverting to an older version? Cheers

fonziemedia avatar Jan 16 '16 00:01 fonziemedia

I just ran into this for the first time on a jpg when testing. It only happens for me when using showProgress:true setting

For everyone else who has encountered the issue, are you also using showProgress? Can you verify that if you turn the progress display off that you dont get the error?

marrone avatar Aug 27 '16 12:08 marrone

@marrone Confirmed. I just got the error with showProgress: true, then I changed it to false and everything worked fine.

gabrielmaldi avatar Aug 29 '16 00:08 gabrielmaldi

@marrone Without showProgress: true, it's working. But it was cool to look at some progress while working with lots of images... :sob:

HugoHeneault avatar Sep 20 '16 12:09 HugoHeneault

This happens when using grunt-tinypng with grunt watch, if it can help.

HugoHeneault avatar Sep 20 '16 12:09 HugoHeneault

Thanks, I'll debug it further when I have a chance, at least now I know how to repro it.

marrone avatar Sep 21 '16 09:09 marrone

Hey, @marrone, have you had a chance to look into this?

I just tried v0.6.1 on node v8.11.1 and the issue still repros.

Perhaps it's caused by some outdated package dependency?

Thanks!

gabrielmaldi avatar Aug 28 '18 14:08 gabrielmaldi

@gabrielmaldi Try to disable showProgress option :)

HugoHeneault avatar Aug 28 '18 16:08 HugoHeneault

@HugoHeneault yes, I did that two years ago; I just wanted to know if we could get the progress indicator back 😄. Thanks!

gabrielmaldi avatar Aug 28 '18 16:08 gabrielmaldi

Woops I didn't read right. My bad 😂

HugoHeneault avatar Aug 28 '18 17:08 HugoHeneault

I can confirm the same behavior described here.

sbwrege2z avatar Jun 16 '19 19:06 sbwrege2z