Tools: ES6 minification on Safari 10 (macOS + iOS)-> SyntaxError: Cannot declare a let variable twice: 'a'.

Created on 17 Nov 2017  路  8Comments  路  Source: Polymer/tools

Description

Both ES6-unbundled and ES6-bundled presets result in an app that fails at launch on iOS 10, but not on iOS 11. The ES5-bundled preset works fine.

Error
SyntaxError: Cannot declare a let variable twice: 'a'.
(And a bunch of others which seem to follow this one)

Versions & Environment

  • polymer-build: 2.1.1
  • node: 8.9.1
  • Operating System: macOS 10.13.1

Steps to Reproduce

  • polymer init -> polymer-starter-kit
  • polymer build
  • polymer serve build/es6-unbundled or build/es6-bundled
  • Open an iPhone Simulator
  • Navigate to localhost:8081, witness the white screen and see console for error

Expected Results

No error is thrown and app loads normally, as on iOS 11

Actual Results

White screen and a bunch of console errors

build

Most helpful comment

Yes, desktop Safari 10.1.1. For now, we had to disable js-minification:

"builds": [
    {
      "preset": "es6-bundled",
      "js": { "minify" : false }
    }
  ]

Not satisfactory of course, yet it'll have to do for now.

All 8 comments

More specifically, it has to do with js minification =>聽unminified versions of these presets seem to work

Any news on this? We have to serve an unminified version of our app to customers because of this (26% heavier).

The same issue appears when opened in Safari, for both build/es6-unbundled and build/es6-bundled. build/es5-bundled works fine.

@czellweg Desktop Safari 10?

Yes, desktop Safari 10.1.1. For now, we had to disable js-minification:

"builds": [
    {
      "preset": "es6-bundled",
      "js": { "minify" : false }
    }
  ]

Not satisfactory of course, yet it'll have to do for now.

As we have. I'll update the title for desktop and mobile

This issue was moved to Polymer/polymer-cli#946

I moved this because it's the CLI that actually handles minificiation by calling out to Babili.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idoshamun picture idoshamun  路  3Comments

NeoLegends picture NeoLegends  路  3Comments

manolo picture manolo  路  4Comments

Westbrook picture Westbrook  路  4Comments

lpellegr picture lpellegr  路  4Comments