Cannot declare a let variable twice: 'e'


#1

Error: SyntaxError: Cannot declare a let variable twice: 'e'.

Affected Versions: iOS 10.3, 10.1 devices/simulators

Meteor version: 1.5.0
Packages:

abernix:minifier-js@2.1.0,
abernix:standard-minifier-js@2.1.0

Cordova plugins:

cordova-plugin-camera@2.3.1
cordova-plugin-compat@1.1.0
cordova-plugin-device@1.1.5
cordova-plugin-geolocation@2.4.1
cordova-plugin-googleplus@https://github.com/yehiasalam/cordova-plugin-googleplus.git#305e04da839f048284e50111dc2a89b24361adf3
cordova-plugin-media-capture@2.0.0
cordova-plugin-meteor-webapp@1.4.2
cordova-plugin-splashscreen@4.0.1
phonegap-plugin-push@1.6.4

Summary: I originally replaced the standard-minifier-* packages with the abernixs fork and that resolved my meteor build issues when building/deploying for production. However my production builds for iOS devices started to be affected recently. I kept getting the error above on iOS 10 devices. I’m presuming there is a missing version lock on minify somewhere.

Solution: After some searching this thread provided the solution. You can pass options into minify. So as suggested I flipped safari10 to true in minify.js and that cleared up my problem with iOS 10 production builds!

Here is where I made this hacky change and looking for suggestions on making a cleaner solution for myself.

/Users/USER/.meteor/packages/abernix_standard-minifier-js/.2.1.0.1v4h096++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/abernix_minifier-js/node_modules/uglify-es/lib/minify.js

/Users/USER/.meteor/packages/abernix_minifier-js/.2.1.0.106pai4++os+web.browser+web.cordova/npm/node_modules/uglify-es/lib/minify.js

In both files there is

if (options.mangle) {
            options.mangle = defaults(options.mangle, {
                cache: null,
                eval: false,
                ie8: false,
                keep_classnames: false,
                keep_fnames: false,
                properties: false,
                reserved: [],
                safari10: true,
                toplevel: false,
            }, true);
        }

I flipped safari 10 to true in both files. So my question, whats a cleaner solution to this? This works for now but eventually these files could be deleted since they’re in my .meteor. So far I have found that in the next Meteor release uglify-es will be bumped up in version.


#2

I am having similar problems when on Android Kitkat 19. It however seems to work on other versions or no problem reported yet. Removing standard-minifier.js seems to remove the problem.