sombreptile's avatar

Elixir / Uglify minified javascript errors in Safari

I'm seeing dozens of errors like this only in Safari and only on minified javascript:

"SyntaxError: Cannot declare a parameter named 'e' as it shadows the name of a strict mode function"

It may be related to this:

https://github.com/mishoo/UglifyJS2/issues/179

Upgrading to the latest uglify seems to resolve it. Is it possible to upgrade Elixir's gulp-uglify dependency without breaking?

0 likes
8 replies
topvillas's avatar

It should be as simple changing the version number in the Elixir package.json and running npm update.

sombreptile's avatar

@topvillas I changed the version number of gulp-uglify in Elixir's package.json and ran "npm update laravel-elixir". It updated to [email protected] but gulp-uglify version reverted to the original. I changed the gulp-uglify version again and ran "npm update laravel-elixir" again but nothing happened.

christiangerdes's avatar

I've had the same issue before. I just had to compile my assets for production and then it worked in safari too.

sombreptile's avatar

@topvillas Scratch that, I just cd'd into the laraval-elixir directory and ran npm update and gulp-uglify updated. I'll see if that fixes the issue.

@christiangerdes It happens in Safari when I run gulp --production. I'll see what happens now that I updated gulp-uglify

Please or to participate in this conversation.