Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Recent uglify changes cause errors on older browsers #288

Closed
adregan opened this issue Mar 27, 2018 · 3 comments
Closed

Recent uglify changes cause errors on older browsers #288

adregan opened this issue Mar 27, 2018 · 3 comments

Comments

@adregan
Copy link

adregan commented Mar 27, 2018

This recent PR—specifically, the change to the uglify options—causes errors in older browsers (namely IE11) in certain situations.

For example, if uglify (with its config on ecma: 8) receives an object like:

{ foo: foo, bar: bar, baz: baz }

it will convert the object to:

{ foo, bar, baz }

causing a syntax error Expected ':'.

NOTE: this happens most reliably with the window object as uglify won't mangle its name.

Currently, we are getting around this issue with a webpack override that changes the ecma setting to 5 rather than 8, but as I suspect others might have this issue as well, a formal option might be nice.

Alternatively, I think there is room to discuss whether transpiling code is beyond the responsibility of an uglifier. Especially if an explicit target is set in the tsconfig (we target our compiled typescript to es5, and would prefer if the uglifier respected that).

Thanks for all the hard work! I'm very grateful to be able to use typescript and create-react-app together.

@Trufinol
Copy link

Also, I've found an error with compiling unicode symbols that occurs when building the app.

For example, in dev mode we have "\u00df", but compiled bundle in production looks like "\u{00df}" (with curly braces), which causes IE11 to throw an error.

There is no such problem in 2.13.0

@DorianGrey
Copy link
Collaborator

Reported issue is fixed by #297 and will be included in the next release.

@mikebridge
Copy link

I am logging all kinds of errors with 2.14.0 indicating it's not exporting es5, e.g. Uncaught SyntaxError: Unexpected token =>. Hope this fixes it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants