imagemin / imagemin-pngquant

Imagemin plugin for `pngquant`
MIT License
316 stars 81 forks source link

SyntaxError: Invalid regular expression: /^.*?\((?<label>.*?)[,)]/: Invalid group #73

Open fsultani opened 3 years ago

fsultani commented 3 years ago

When deploying an app via Heroku, there's an error: SyntaxError: Invalid regular expression: /^.*?\((?<label>.*?)[,)]/: Invalid group. The stack trace seems to point back to imagemin-pngquant, which uses ow, which is where this regex is being used.

ow is currently on v.0.19.0, whereas imagemin-pngquant is still using v.0.17.0 (https://github.com/imagemin/imagemin-pngquant/blob/master/package.json#L30). Can it be upgraded to v.0.19.0 to see if it fixes the error?

DanielBielczyk commented 3 years ago

@fsultani Just ran into the same issue. In my case, the problem was old Node (v 8.x), which didn't support named groups in regexps - they are supported since node 10.x. I updated and it's ok now.

Hancoson commented 3 years ago

I had the same problem. node v10.x. How to solve?

adammoisa commented 3 years ago

Solved by switching to node 12.16.1